Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

joshtriplett
Copy link
Member

Eliminate a use of map_or in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 25, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@lcnr
Copy link
Contributor

lcnr commented Sep 26, 2025

hmm, imo this doesn't provide a lot of readability benefit. I think I personally would have replaced it with one/two early returns instead

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

📌 Commit 9e3f748 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 26, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
mbe: Simplify check_redundant_vis_repetition

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 7 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146778 (Use standard attribute logic for allocator shim)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
mbe: Simplify check_redundant_vis_repetition

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
mbe: Simplify check_redundant_vis_repetition

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 10 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146704 (port `#[debugger_visualizer]` to the new attribute system)
 - #146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - #146778 (Use standard attribute logic for allocator shim)
 - #146849 (Reduce some uses of `LegacyBang`)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 27, 2025
Rollup of 10 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146704 (port `#[debugger_visualizer]` to the new attribute system)
 - #146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - #146778 (Use standard attribute logic for allocator shim)
 - #146849 (Reduce some uses of `LegacyBang`)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 978c960 into rust-lang:master Sep 27, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 27, 2025
rust-timer added a commit that referenced this pull request Sep 27, 2025
Rollup merge of #147031 - joshtriplett:mbe-opt-collect, r=lcnr

mbe: Simplify check_redundant_vis_repetition

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
@joshtriplett joshtriplett deleted the mbe-opt-collect branch September 28, 2025 17:49
@joshtriplett
Copy link
Member Author

hmm, imo this doesn't provide a lot of readability benefit. I think I personally would have replaced it with one/two early returns instead

I did start out replacing it with early returns, but then realized that required inverting the conditionals. I felt like it was slightly less readable with the second conditional inverted.

github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Sep 29, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145113 (resolve: Do not finalize shadowed bindings)
 - rust-lang/rust#146523 (Demote both armebv7r-none-* targets.)
 - rust-lang/rust#146704 (port `#[debugger_visualizer]` to the new attribute system)
 - rust-lang/rust#146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - rust-lang/rust#146778 (Use standard attribute logic for allocator shim)
 - rust-lang/rust#146849 (Reduce some uses of `LegacyBang`)
 - rust-lang/rust#147016 (fix doc comments to be more standard)
 - rust-lang/rust#147027 (Add new `tyalias` intra-doc link disambiguator)
 - rust-lang/rust#147031 (mbe: Simplify check_redundant_vis_repetition)
 - rust-lang/rust#147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants