Suggest let for assignment, and some code refactor#101908
Suggest let for assignment, and some code refactor#101908bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
By the way, |
b62b110 to
1a76ead
Compare
92e6500 to
14a7042
Compare
We should, but better to do it as part of its own PR. |
|
☔ The latest upstream changes (presumably #102450) made this pull request unmergeable. Please resolve the merge conflicts. |
99a33b3 to
7d201c9
Compare
|
r? @estebank |
|
☔ The latest upstream changes (presumably #103185) made this pull request unmergeable. Please resolve the merge conflicts. |
estebank
left a comment
There was a problem hiding this comment.
r=me after rebasing (ping me and I'll approve)
There was a problem hiding this comment.
This can now be written as follows
| let has_eq = matches!(sm.span_to_snippet(eq_span), Ok(ref snippet) if snippet == "="); | |
| if has_eq { | |
| if let Ok(ref snippet) = sm.span_to_snippet(eq_span) && snippet == "=" { |
There was a problem hiding this comment.
Is this check to protect against macros or something else?
There was a problem hiding this comment.
Ah, yes. Saw the dbg!(binding) case in the test. Hacky, but makes sense!
There was a problem hiding this comment.
emm, I will add a comment for this.
7d201c9 to
d808fb0
Compare
This comment has been minimized.
This comment has been minimized.
d808fb0 to
eb68e27
Compare
| break; | ||
| } | ||
| } | ||
| let closing_span = sm.span_look_ahead(span, Some("}"), Some(50)); |
There was a problem hiding this comment.
Since the next_point bug is fixed, this is changed from 100 to 50 😂
|
r? @estebank |
|
@bors r+ |
Suggest let for assignment, and some code refactor Fixes rust-lang#101880
Rollup of 6 pull requests Successful merges: - rust-lang#101293 (Recover when unclosed char literal is parsed as a lifetime in some positions) - rust-lang#101908 (Suggest let for assignment, and some code refactor) - rust-lang#103192 (rustdoc: Eliminate uses of `EarlyDocLinkResolver::all_traits`) - rust-lang#103226 (Check `needs_infer` before `needs_drop` during HIR generator analysis) - rust-lang#103249 (resolve: Revert "Set effective visibilities for imports more precisely") - rust-lang#103305 (Move some tests to more reasonable places) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
|
Thank you @chenyukang |
Fixes #101880