Skip to content
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

Replace trivial bool matches with the matches! macro #77886

Merged
merged 1 commit into from
Oct 14, 2020

Conversation

LingMan
Copy link
Contributor

@LingMan LingMan commented Oct 13, 2020

This derives PartialEq on one enum (and two structs it contains) to enable the == operator for it. If there's some downside to this, I could respin with the matches! macro instead.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2020
@petrochenkov
Copy link
Contributor

matches! would be a better fit here, not much sense in generating the PartialEq impls if they are not fully used and used rarely.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 13, 2020
@LingMan LingMan changed the title Replace trivial bool matches with comparisons Replace trivial bool matches with the matches! macro Oct 13, 2020
@LingMan
Copy link
Contributor Author

LingMan commented Oct 13, 2020

Changed.

@rustbot modify labels: -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 13, 2020
@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 13, 2020

📌 Commit 7a23a71 has been approved by petrochenkov

@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 Oct 13, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2020
Rollup of 14 pull requests

Successful merges:

 - rust-lang#77239 (Enable building Cargo for aarch64-apple-darwin)
 - rust-lang#77569 (BTreeMap: type-specific variants of node_as_mut and cast_unchecked)
 - rust-lang#77719 (Remove unnecessary rustc_const_stable attributes.)
 - rust-lang#77722 (Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn).)
 - rust-lang#77725 (Add regression issue template)
 - rust-lang#77776 ( Give an error when running `x.py test --stage 0 src/test/ui`)
 - rust-lang#77786 (Mention rustdoc in `x.py setup`)
 - rust-lang#77825 (`min_const_generics` diagnostics improvements)
 - rust-lang#77868 (Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component)
 - rust-lang#77884 (Use Option::unwrap_or instead of open-coding it)
 - rust-lang#77886 (Replace trivial bool matches with the `matches!` macro)
 - rust-lang#77892 (Replace absolute paths with relative ones)
 - rust-lang#77895 (Include aarch64-apple-darwin in the dist manifests)
 - rust-lang#77909 (bootstrap: set correct path for the build-manifest binary)

Failed merges:

 - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests)

r? `@ghost`
@bors bors merged commit 083638c into rust-lang:master Oct 14, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 14, 2020
@LingMan LingMan deleted the ast_pretty_bool_matches branch October 14, 2020 03:48
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants