Skip to content

Conversation

Ryman
Copy link
Contributor

@Ryman Ryman commented Oct 28, 2015

This helps for the case where a match, such as below:

let foo = match foo {
    Some(x) => x,
    None => 0
};

gets refactored to no longer need the match, but the match keyword has been left accidentally:

let foo = match foo.unwrap_or(0);

This can be hard to spot as the expression grows more complex.

r? @alexcrichton

@alexcrichton
Copy link
Member

@bors: r+ 99ecf4e

Neat!

@bors
Copy link
Collaborator

bors commented Oct 29, 2015

⌛ Testing commit 99ecf4e with merge 2af9aab...

bors added a commit that referenced this pull request Oct 29, 2015
This helps for the case where a match, such as below:
```rust
let foo = match foo {
    Some(x) => x,
    None => 0
};
```
gets refactored to no longer need the match, but the match keyword has been left accidentally: 

```rust
let foo = match foo.unwrap_or(0);
```

This can be hard to spot as the expression grows more complex.

r? @alexcrichton
@bors bors merged commit 99ecf4e into rust-lang:master Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants