rustdoc: remove explicit boolean comparisons.#85124
Merged
bors merged 1 commit intorust-lang:masterfrom May 12, 2021
Merged
Conversation
Contributor
|
Some changes occurred in HTML/CSS/JS. |
Member
|
Just checked and apparently, it doesn't seem to impact boolean comparisons, only the other types. |
GuillaumeGomez
requested changes
May 9, 2021
Member
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.
Collaborator
|
☔ 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.
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
approved these changes
May 11, 2021
Member
|
Thanks! @bors: r+ |
Collaborator
|
📌 Commit f510e41 has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 11, 2021
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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