@@ -79,10 +79,10 @@ LL | | };
7979 | |_____^ help: try this: `None::<()>.is_none()`
8080
8181error: redundant pattern matching, consider using `is_none()`
82- --> $DIR/redundant_pattern_matching.rs:56:15
82+ --> $DIR/redundant_pattern_matching.rs:56:13
8383 |
84- LL | let foo = match None::<()> {
85- | _______________ ^
84+ LL | let _ = match None::<()> {
85+ | _____________ ^
8686LL | | Some(_) => false,
8787LL | | None => true,
8888LL | | };
@@ -94,16 +94,20 @@ error: redundant pattern matching, consider using `is_ok()`
9494LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
9595 | -------^^^^^--------------------------------------------- help: try this: `Ok::<usize, ()>(4).is_ok()`
9696
97- error: this let-binding has unit value
98- --> $DIR/redundant_pattern_matching.rs:64:5
97+ error: redundant pattern matching, consider using `is_some()`
98+ --> $DIR/redundant_pattern_matching.rs:67:20
9999 |
100- LL | let _ = returns_unit();
101- | ^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `returns_unit();`
100+ LL | let x = if let Some(_) = opt { true } else { false };
101+ | -------^^^^^^^------------------------------ help: try this: `opt.is_some()`
102+
103+ error: redundant pattern matching, consider using `is_some()`
104+ --> $DIR/redundant_pattern_matching.rs:69:20
102105 |
103- = note: `-D clippy::let-unit-value` implied by `-D warnings`
106+ LL | let y = if let Some(_) = opt {};
107+ | -------^^^^^^^--------- help: try this: `opt.is_some()`
104108
105109error: redundant pattern matching, consider using `is_ok()`
106- --> $DIR/redundant_pattern_matching.rs:68 :12
110+ --> $DIR/redundant_pattern_matching.rs:77 :12
107111 |
108112LL | if let Ok(_) = Ok::<i32, i32>(4) {
109113 | _____- ^^^^^
@@ -114,7 +118,7 @@ LL | | }
114118 | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
115119
116120error: redundant pattern matching, consider using `is_ok()`
117- --> $DIR/redundant_pattern_matching.rs:76 :12
121+ --> $DIR/redundant_pattern_matching.rs:85 :12
118122 |
119123LL | if let Ok(_) = Ok::<i32, i32>(4) {
120124 | _____- ^^^^^
@@ -124,5 +128,5 @@ LL | | false
124128LL | | };
125129 | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
126130
127- error: aborting due to 15 previous errors
131+ error: aborting due to 16 previous errors
128132
0 commit comments