Commit c243129
committed
fix: wrap parentheses on guard for replace_if_let_with_match
Example
---
```rust
fn main() {
match$0 Some(0) {
Some(n) if n % 2 == 0 || n == 7 => (),
_ => (),
}
}
```
**Before this PR**
```rust
fn main() {
if let Some(n) = Some(0) && n % 2 == 0 || n == 7 {
()
}
}
```
**After this PR**
```rust
fn main() {
if let Some(n) = Some(0) && (n % 2 == 0 || n == 7) {
()
}
}
```1 parent 671ba41 commit c243129
1 file changed
Lines changed: 28 additions & 3 deletions
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
289 | 292 | | |
290 | 293 | | |
291 | 294 | | |
| 295 | + | |
292 | 296 | | |
293 | 297 | | |
294 | 298 | | |
| |||
2268 | 2272 | | |
2269 | 2273 | | |
2270 | 2274 | | |
2271 | | - | |
| 2275 | + | |
2272 | 2276 | | |
2273 | 2277 | | |
2274 | 2278 | | |
2275 | 2279 | | |
2276 | 2280 | | |
2277 | 2281 | | |
2278 | | - | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
2279 | 2304 | | |
2280 | 2305 | | |
2281 | 2306 | | |
| |||
0 commit comments