-
Notifications
You must be signed in to change notification settings - Fork 13.8k
mbe: Simplify check_redundant_vis_repetition #147031
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
Conversation
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.
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 |
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.
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
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.
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.
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
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
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.
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. |
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
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.