-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
collaps if x {} else { if .. } conditions #80793
Conversation
Fixes clippy::collapsible_else_if reduces nesting of ```` if x { A } else { if y { B } else { C } } ```` to ```` if x { A } else if y { B } else C } ````
Some changes occurred in intra-doc-links. cc @jyn514 |
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
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.
Rustdoc changes LGTM
cmd.args(args); | ||
} | ||
} else if let Some(args) = sess.target.late_link_args_static.get(&flavor) { | ||
cmd.args(args); | ||
} |
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.
FWIW I feel like this change is hiding intent - previously the code was pretty clearly handling the dynamic and non-dynamic cases, but now it is less obvious IMO, at least for me.
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'm slightly concerned about reshaping this hiding intent in some cases, but the code changes are all functionally the same.
What was the trigger to look into cleaning up this pattern in the codebase?
I'm r=me but see multiple places where I wish we had more comments.
} else if !args.named_args.is_empty() || !args.reg_args.is_empty() { | ||
let mut err = ecx.struct_span_err( | ||
span, | ||
"positional arguments cannot follow named arguments \ | ||
or explicit register 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.
Fix indentation
☔ The latest upstream changes (presumably #80928) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage @rustbot label: -S-waiting-on-review +S-waiting-on-author |
I'm closing this in regard to the criticism regarding readability. |
Fixes clippy::collapsible_else_if
reduces nesting of
to