Skip to content

Avoid unnecessary pattern matching against Option and Result #52773

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

ljedrz
Copy link
Contributor

@ljedrz ljedrz commented Jul 27, 2018

No description provided.

@rust-highfive
Copy link
Contributor

r? @eddyb

(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 Jul 27, 2018
@ljedrz ljedrz force-pushed the unncecessary_patterns branch from 963b8a8 to f1dbdac Compare July 29, 2018 08:49
@ljedrz
Copy link
Contributor Author

ljedrz commented Jul 29, 2018

Rebased after 4c1cb75.

@eddyb
Copy link
Member

eddyb commented Jul 29, 2018

r? @nikomatsakis (some of these might be intentional)

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb Jul 29, 2018
Copy link
Contributor

@nikomatsakis nikomatsakis left a 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() {
Copy link
Contributor

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

Copy link
Contributor Author

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.

@ljedrz ljedrz force-pushed the unncecessary_patterns branch from f1dbdac to 44d32d4 Compare August 7, 2018 08:26
@ljedrz
Copy link
Contributor Author

ljedrz commented Aug 7, 2018

@nikomatsakis done.

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 7, 2018

📌 Commit 44d32d4 has been approved by nikomatsakis

@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 Aug 7, 2018
cramertj added a commit to cramertj/rust that referenced this pull request Aug 8, 2018
…omatsakis

Avoid unnecessary pattern matching against Option and Result
cramertj added a commit to cramertj/rust that referenced this pull request Aug 8, 2018
…omatsakis

Avoid unnecessary pattern matching against Option and Result
cramertj added a commit to cramertj/rust that referenced this pull request Aug 8, 2018
…omatsakis

Avoid unnecessary pattern matching against Option and Result
cramertj added a commit to cramertj/rust that referenced this pull request Aug 8, 2018
…omatsakis

Avoid unnecessary pattern matching against Option and Result
kennytm added a commit to kennytm/rust that referenced this pull request Aug 9, 2018
…omatsakis

Avoid unnecessary pattern matching against Option and Result
bors added a commit that referenced this pull request Aug 9, 2018
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)
@bors bors merged commit 44d32d4 into rust-lang:master Aug 9, 2018
@ljedrz ljedrz deleted the unncecessary_patterns branch August 10, 2018 05:31
# for free to join this conversation on GitHub. Already have an account? # 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