-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Don't use matches! when == suffices
#150405
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
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs Some changes occurred to constck cc @fee1-dead Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to the CTFE machinery |
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
This comment has been minimized.
This comment has been minimized.
In the codebase we sometimes use `matches!` for values that can actually just be compared. Replace them with `==`.
f77875a to
9f566f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but honestly it's so unusual to read pattern matching with a ==, when I find matches! more familiar
If this is what we are in favour to, because as far as I understand previous discussion ended on that we want to use == instead of matches!, then yeah, let's do it, I guess i will get used to it pretty fast
|
I personally prefer using |
|
r? me @bors r+ rollup |
…uwer Rollup of 2 pull requests Successful merges: - rust-lang/rust#150393 (Document relative and absolute paths handling in `--remap-path-prefix`) - rust-lang/rust#150405 (Don't use `matches!` when `==` suffices) r? `@ghost` `@rustbot` modify labels: rollup
In the codebase we sometimes use
matches!for values that can actually just be compared. Replace them with==.Subset of #149933.