1
1
error: redundant pattern matching, consider using `is_ok()`
2
- --> $DIR/redundant_pattern_matching.rs:5 :12
2
+ --> $DIR/redundant_pattern_matching.rs:6 :12
3
3
|
4
4
LL | if let Ok(_) = Ok::<i32, i32>(42) {}
5
5
| -------^^^^^------------------------ help: try this: `Ok::<i32, i32>(42).is_ok()`
6
6
|
7
7
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
8
9
9
error: redundant pattern matching, consider using `is_err()`
10
- --> $DIR/redundant_pattern_matching.rs:7 :12
10
+ --> $DIR/redundant_pattern_matching.rs:8 :12
11
11
|
12
12
LL | if let Err(_) = Err::<i32, i32>(42) {}
13
13
| -------^^^^^^------------------------- help: try this: `Err::<i32, i32>(42).is_err()`
14
14
15
15
error: redundant pattern matching, consider using `is_none()`
16
- --> $DIR/redundant_pattern_matching.rs:9 :12
16
+ --> $DIR/redundant_pattern_matching.rs:10 :12
17
17
|
18
18
LL | if let None = None::<()> {}
19
19
| -------^^^^---------------- help: try this: `None::<()>.is_none()`
20
20
21
21
error: redundant pattern matching, consider using `is_some()`
22
- --> $DIR/redundant_pattern_matching.rs:11 :12
22
+ --> $DIR/redundant_pattern_matching.rs:12 :12
23
23
|
24
24
LL | if let Some(_) = Some(42) {}
25
25
| -------^^^^^^^-------------- help: try this: `Some(42).is_some()`
26
26
27
27
error: redundant pattern matching, consider using `is_ok()`
28
- --> $DIR/redundant_pattern_matching.rs:25 :5
28
+ --> $DIR/redundant_pattern_matching.rs:26 :5
29
29
|
30
30
LL | / match Ok::<i32, i32>(42) {
31
31
LL | | Ok(_) => true,
@@ -34,7 +34,7 @@ LL | | };
34
34
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
35
35
36
36
error: redundant pattern matching, consider using `is_err()`
37
- --> $DIR/redundant_pattern_matching.rs:30 :5
37
+ --> $DIR/redundant_pattern_matching.rs:31 :5
38
38
|
39
39
LL | / match Ok::<i32, i32>(42) {
40
40
LL | | Ok(_) => false,
@@ -43,7 +43,7 @@ LL | | };
43
43
| |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
44
44
45
45
error: redundant pattern matching, consider using `is_err()`
46
- --> $DIR/redundant_pattern_matching.rs:35 :5
46
+ --> $DIR/redundant_pattern_matching.rs:36 :5
47
47
|
48
48
LL | / match Err::<i32, i32>(42) {
49
49
LL | | Ok(_) => false,
@@ -52,7 +52,7 @@ LL | | };
52
52
| |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
53
53
54
54
error: redundant pattern matching, consider using `is_ok()`
55
- --> $DIR/redundant_pattern_matching.rs:40 :5
55
+ --> $DIR/redundant_pattern_matching.rs:41 :5
56
56
|
57
57
LL | / match Err::<i32, i32>(42) {
58
58
LL | | Ok(_) => true,
@@ -61,7 +61,7 @@ LL | | };
61
61
| |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
62
62
63
63
error: redundant pattern matching, consider using `is_some()`
64
- --> $DIR/redundant_pattern_matching.rs:45 :5
64
+ --> $DIR/redundant_pattern_matching.rs:46 :5
65
65
|
66
66
LL | / match Some(42) {
67
67
LL | | Some(_) => true,
@@ -70,13 +70,59 @@ LL | | };
70
70
| |_____^ help: try this: `Some(42).is_some()`
71
71
72
72
error: redundant pattern matching, consider using `is_none()`
73
- --> $DIR/redundant_pattern_matching.rs:50 :5
73
+ --> $DIR/redundant_pattern_matching.rs:51 :5
74
74
|
75
75
LL | / match None::<()> {
76
76
LL | | Some(_) => false,
77
77
LL | | None => true,
78
78
LL | | };
79
79
| |_____^ help: try this: `None::<()>.is_none()`
80
80
81
- error: aborting due to 10 previous errors
81
+ error: redundant pattern matching, consider using `is_none()`
82
+ --> $DIR/redundant_pattern_matching.rs:56:15
83
+ |
84
+ LL | let foo = match None::<()> {
85
+ | _______________^
86
+ LL | | Some(_) => false,
87
+ LL | | None => true,
88
+ LL | | };
89
+ | |_____^ help: try this: `None::<()>.is_none()`
90
+
91
+ error: redundant pattern matching, consider using `is_ok()`
92
+ --> $DIR/redundant_pattern_matching.rs:61:20
93
+ |
94
+ LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
95
+ | -------^^^^^--------------------------------------------- help: try this: `Ok::<usize, ()>(4).is_ok()`
96
+
97
+ error: this let-binding has unit value
98
+ --> $DIR/redundant_pattern_matching.rs:64:5
99
+ |
100
+ LL | let _ = returns_unit();
101
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `returns_unit();`
102
+ |
103
+ = note: `-D clippy::let-unit-value` implied by `-D warnings`
104
+
105
+ error: redundant pattern matching, consider using `is_ok()`
106
+ --> $DIR/redundant_pattern_matching.rs:68:12
107
+ |
108
+ LL | if let Ok(_) = Ok::<i32, i32>(4) {
109
+ | _____- ^^^^^
110
+ LL | | true
111
+ LL | | } else {
112
+ LL | | false
113
+ LL | | }
114
+ | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
115
+
116
+ error: redundant pattern matching, consider using `is_ok()`
117
+ --> $DIR/redundant_pattern_matching.rs:76:12
118
+ |
119
+ LL | if let Ok(_) = Ok::<i32, i32>(4) {
120
+ | _____- ^^^^^
121
+ LL | | true
122
+ LL | | } else {
123
+ LL | | false
124
+ LL | | };
125
+ | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
126
+
127
+ error: aborting due to 15 previous errors
82
128
0 commit comments