Uh oh!
There was an error while loading. Please reload this page.
rustdoc: remove explicit boolean comparisons. - #85124
Conversation
rust-highfive
commented
May 9, 2021
Some changes occurred in HTML/CSS/JS. |
GuillaumeGomez
commented
May 9, 2021
Just checked and apparently, it doesn't seem to impact boolean comparisons, only the other types. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
GuillaumeGomez
left a comment
There was a problem hiding this comment.
A few things to change but otherwise looks good, thanks!
This comment has been minimized.
This comment has been minimized.
bors
commented
May 10, 2021
☔ The latest upstream changes (presumably #85074) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
For boolean variables it's shorter and more readable to check the value directly, or negate it with `!`. In a couple of cases I reordered an if/else pair because it made the initial `if` statement simpler. Removed unused isType parameter from two functions.
GuillaumeGomez
commented
May 11, 2021
Thanks! @bors: r+ |
bors
commented
May 11, 2021
📌 Commit f510e41 has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#83501 (rustdoc: Add unstable CLI option to show basic type layout information) - rust-lang#85018 (shrinking the deprecated method span) - rust-lang#85124 (rustdoc: remove explicit boolean comparisons.) - rust-lang#85136 (Change param name (k to key and v to value) in std::env module) - rust-lang#85162 (Fix typo in variable name) - rust-lang#85187 (Use .name_str() to format primitive types in error messages) - rust-lang#85191 (Improve rustdoc gui tester) - rust-lang#85196 (Revert "Auto merge of rust-lang#84797 - richkadel:cover-unreachable-statements…) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
For boolean variables it's shorter and more readable to check the value directly, or negate it with
!.In a couple of cases I reordered an if/else pair because it made the initial
ifstatement simpler.An example of a style guide recommending this: https://airbnb.io/javascript/#comparison--shortcuts
r? @GuillaumeGomez