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

match match match match match #59583

Merged
merged 1 commit into from
Mar 31, 2019
Merged

match match match match match #59583

merged 1 commit into from
Mar 31, 2019

Conversation

oberien
Copy link
Contributor

@oberien oberien commented Mar 31, 2019

The match keyword can be chained as long as there are enough body-blocks following, and the output of one match will be the input of the next match.

I accidentally wrote something among the lines of this:

match match Ok(Some(1337)) {
    Ok(val) => val,
    Err(err) => handle_err(err),
} {
    Some(foo) => handle_foo(foo),
    None => {},
}

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(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 Mar 31, 2019
@Centril
Copy link
Contributor

Centril commented Mar 31, 2019

Sure... why not... 😂 it is not a bad test actually.

r? @Centril @bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 31, 2019

📌 Commit 55b7efe has been approved by Centril

@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 Mar 31, 2019
Centril added a commit to Centril/rust that referenced this pull request Mar 31, 2019
bors added a commit that referenced this pull request Mar 31, 2019
Rollup of 7 pull requests

Successful merges:

 - #58805 (Lint for redundant imports)
 - #59506 (Use platform dependent mcount function)
 - #59519 (rustc_target: factor out common fields of non-Single Variants.)
 - #59580 (Allow closure to unsafe fn coercion)
 - #59581 (Stabilize refcell_replace_swap feature)
 - #59583 (match match match match match)
 - #59587 (Remove #[doc(hidden)] from Error::type_id)

Failed merges:

r? @ghost
@tesuji
Copy link
Contributor

tesuji commented Mar 31, 2019

A description explains why it exists or where the idea came from is better.

@Centril
Copy link
Contributor

Centril commented Mar 31, 2019

Regardless this actually tests some good aspects of raw identifiers and match's syntax so it is fine to add.

@tesuji
Copy link
Contributor

tesuji commented Mar 31, 2019

That's a good explain. The PR owner could add that in PR description.

@bors bors merged commit 55b7efe into rust-lang:master Mar 31, 2019
@oberien oberien deleted the patch-1 branch March 31, 2019 21:55
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.

6 participants