collaps if x {} else { if .. } conditions#80793
collaps if x {} else { if .. } conditions#80793matthiaskrgr wants to merge 1 commit intorust-lang:masterfrom
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) |
| } | ||
| } else if let Some(args) = sess.target.late_link_args_static.get(&flavor) { | ||
| cmd.args(args); | ||
| } |
There was a problem hiding this comment.
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.
estebank
left a comment
There was a problem hiding this comment.
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.
| let mut err = ecx.struct_span_err( | ||
| span, | ||
| "positional arguments cannot follow named arguments \ | ||
| or explicit register arguments", |
|
☔ 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