]> git.lizzy.rs Git - rust.git/commitdiff
Merge #6731
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Mon, 7 Dec 2020 15:00:07 +0000 (15:00 +0000)
committerGitHub <noreply@github.com>
Mon, 7 Dec 2020 15:00:07 +0000 (15:00 +0000)
6731: Add replace_match_with_if_let assist r=matklad a=Veykril

Basically the counterpart to `replace_if_let_with_match`, I personally sometimes want to replace matches like
```rust
match foo {
    pat => expr,
    _ => (),
}
```
into the corresponding
```rust
if let pat = foo {
    expr
}
```
which is the main reasoning behind this.
I put this into the same file as `replace_if_let_with_match` because the are complementing each other and I would probably rename the file to something like `replace_if_let_match` but I didn't do that for now because I was unsure whether git would still view this as a rename or not due to the amount of changes in the file so that the diff is still properly visible for now.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>

Trivial merge