-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Avoid unnecessary pattern matching against Option and Result #52773
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
963b8a8
to
f1dbdac
Compare
Rebased after 4c1cb75. |
r? @nikomatsakis (some of these might be intentional) |
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.
Seems fine apart from the one case, where the is_err
is too easily overlooked
.sup(fty.inputs()[0], self_ty) | ||
{ | ||
if self.at(&ObligationCause::dummy(), self.param_env) | ||
.sup(fty.inputs()[0], self_ty).is_err() { |
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.
Nit: I'd prefer to see is_err
on its own line here
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.
Sounds good, I'll update the commit soon.
f1dbdac
to
44d32d4
Compare
@nikomatsakis done. |
@bors r+ rollup |
📌 Commit 44d32d4 has been approved by |
…omatsakis Avoid unnecessary pattern matching against Option and Result
…omatsakis Avoid unnecessary pattern matching against Option and Result
…omatsakis Avoid unnecessary pattern matching against Option and Result
…omatsakis Avoid unnecessary pattern matching against Option and Result
…omatsakis Avoid unnecessary pattern matching against Option and Result
Rollup of 15 pull requests Successful merges: - #52773 (Avoid unnecessary pattern matching against Option and Result) - #53082 (Fix doc link (again)) - #53094 (Automatically expand section if url id point to one of its component) - #53106 (atomic ordering docs) - #53110 (Account for --remap-path-prefix in save-analysis) - #53116 (NetBSD: fix signedess of char) - #53179 (Whitelist wasm32 simd128 target feature) - #53183 (Suggest comma when missing in macro call) - #53207 (Add individual docs for rotate_{left, right}) - #53211 ([nll] enable feature(nll) on various crates for bootstrap) - #53214 ([nll] enable feature(nll) on various crates for bootstrap: part 2) - #53215 (Slightly refactor syntax_ext/format) - #53217 (inline some short functions) - #53219 ([nll] enable feature(nll) on various crates for bootstrap: part 3) - #53222 (A few cleanups for rustc_target)
No description provided.