-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few updates to improve code clarity #6777
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution! Before we can merge this, we need @sharma-shray to sign the Fuel Labs Contributor License Agreement. |
@@ -4178,7 +4178,7 @@ impl<'eng> FnCompiler<'eng> { | |||
.get_elem_ptr_with_idx(tuple_value, field_type, idx as u64) | |||
.add_metadatum(context, span_md_idx) | |||
}) | |||
.ok_or_else(|| { | |||
.ok_or({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These do not have the same behavior.
There is no need to eagerly evaluate an error, surely?
// FIXME we can do better here and return function application expression here | ||
// if there are no parsing errors in the arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for removing this altogether?
let call_path = CallPath { | ||
prefixes: vec![ | ||
Ident::new_with_override("core".into(), op_span.clone()), | ||
Ident::new_with_override("ops".into(), op_span.clone()), | ||
], | ||
suffix: Ident::new_with_override(name.into(), op_span.clone()), | ||
is_absolute: true, | ||
}; | ||
let method_name_binding = TypeBinding { | ||
inner: MethodName::FromTrait { | ||
call_path: CallPath { | ||
prefixes: vec![ | ||
Ident::new_with_override("core".into(), op_span.clone()), | ||
Ident::new_with_override("ops".into(), op_span.clone()), | ||
], | ||
suffix: Ident::new_with_override(name.into(), op_span.clone()), | ||
is_absolute: true, | ||
}, | ||
}, | ||
inner: MethodName::FromTrait { call_path }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how breaking it out makes it clearer here. You've undone it in other instances in this very PR.
CodSpeed Performance ReportMerging #6777 will not alter performanceComparing Summary
|
Description
type anotation, extracting the creation of the CallPath into a separate variable for easier understanding, Inline Destructuring for Simpler Match Pattern
Checklist
Breaking*
orNew Feature
labels where relevant.