@@ -79,10 +79,10 @@ LL | | };
79
79
| |_____^ help: try this: `None::<()>.is_none()`
80
80
81
81
error: redundant pattern matching, consider using `is_none()`
82
- --> $DIR/redundant_pattern_matching.rs:56:15
82
+ --> $DIR/redundant_pattern_matching.rs:56:13
83
83
|
84
- LL | let foo = match None::<()> {
85
- | _______________ ^
84
+ LL | let _ = match None::<()> {
85
+ | _____________ ^
86
86
LL | | Some(_) => false,
87
87
LL | | None => true,
88
88
LL | | };
@@ -94,16 +94,20 @@ error: redundant pattern matching, consider using `is_ok()`
94
94
LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
95
95
| -------^^^^^--------------------------------------------- help: try this: `Ok::<usize, ()>(4).is_ok()`
96
96
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
99
99
|
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
102
105
|
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()`
104
108
105
109
error: redundant pattern matching, consider using `is_ok()`
106
- --> $DIR/redundant_pattern_matching.rs:68 :12
110
+ --> $DIR/redundant_pattern_matching.rs:77 :12
107
111
|
108
112
LL | if let Ok(_) = Ok::<i32, i32>(4) {
109
113
| _____- ^^^^^
@@ -114,7 +118,7 @@ LL | | }
114
118
| |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
115
119
116
120
error: redundant pattern matching, consider using `is_ok()`
117
- --> $DIR/redundant_pattern_matching.rs:76 :12
121
+ --> $DIR/redundant_pattern_matching.rs:85 :12
118
122
|
119
123
LL | if let Ok(_) = Ok::<i32, i32>(4) {
120
124
| _____- ^^^^^
@@ -124,5 +128,5 @@ LL | | false
124
128
LL | | };
125
129
| |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
126
130
127
- error: aborting due to 15 previous errors
131
+ error: aborting due to 16 previous errors
128
132
0 commit comments