Skip to content

Conversation

@splinter012
Copy link

This PR removes redundant code patterns in Result and Option handling, making the codebase more idiomatic and readable.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @splinter012)


crates/cairo-lang-test-plugin/src/lib.rs line 267 at r1 (raw file):

                    return None;
                };
                Some((*func_id, try_extract_test_config(db, attrs).ok().flatten()?))

not better.


crates/cairo-lang-semantic/src/expr/compute.rs line 4817 at r1 (raw file):

            let mut data = InferenceData::new(InferenceId::NoContext);
            let mut inference = data.inference(db);
            let trait_function = db.trait_function_by_name(*trait_id, method_name).ok().flatten()?;

this isn't better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants