1
1
error: redundant pattern matching, consider using `is_none()`
2
- --> $DIR/redundant_pattern_matching_option.rs:14 :12
2
+ --> $DIR/redundant_pattern_matching_option.rs:8 :12
3
3
|
4
4
LL | if let None = None::<()> {}
5
5
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
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_some()`
10
- --> $DIR/redundant_pattern_matching_option.rs:16 :12
10
+ --> $DIR/redundant_pattern_matching_option.rs:10 :12
11
11
|
12
12
LL | if let Some(_) = Some(42) {}
13
13
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
14
14
15
15
error: redundant pattern matching, consider using `is_some()`
16
- --> $DIR/redundant_pattern_matching_option.rs:18 :12
16
+ --> $DIR/redundant_pattern_matching_option.rs:12 :12
17
17
|
18
18
LL | if let Some(_) = Some(42) {
19
19
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
20
20
21
21
error: redundant pattern matching, consider using `is_some()`
22
- --> $DIR/redundant_pattern_matching_option.rs:24 :15
22
+ --> $DIR/redundant_pattern_matching_option.rs:18 :15
23
23
|
24
24
LL | while let Some(_) = Some(42) {}
25
25
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
26
26
27
27
error: redundant pattern matching, consider using `is_none()`
28
- --> $DIR/redundant_pattern_matching_option.rs:26 :15
28
+ --> $DIR/redundant_pattern_matching_option.rs:20 :15
29
29
|
30
30
LL | while let None = Some(42) {}
31
31
| ----------^^^^----------- help: try this: `while Some(42).is_none()`
32
32
33
33
error: redundant pattern matching, consider using `is_none()`
34
- --> $DIR/redundant_pattern_matching_option.rs:28 :15
34
+ --> $DIR/redundant_pattern_matching_option.rs:22 :15
35
35
|
36
36
LL | while let None = None::<()> {}
37
37
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
38
38
39
39
error: redundant pattern matching, consider using `is_some()`
40
- --> $DIR/redundant_pattern_matching_option.rs:31 :15
40
+ --> $DIR/redundant_pattern_matching_option.rs:25 :15
41
41
|
42
42
LL | while let Some(_) = v.pop() {
43
43
| ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
44
44
45
45
error: redundant pattern matching, consider using `is_some()`
46
- --> $DIR/redundant_pattern_matching_option.rs:39 :5
46
+ --> $DIR/redundant_pattern_matching_option.rs:33 :5
47
47
|
48
48
LL | / match Some(42) {
49
49
LL | | Some(_) => true,
@@ -52,7 +52,7 @@ LL | | };
52
52
| |_____^ help: try this: `Some(42).is_some()`
53
53
54
54
error: redundant pattern matching, consider using `is_none()`
55
- --> $DIR/redundant_pattern_matching_option.rs:44 :5
55
+ --> $DIR/redundant_pattern_matching_option.rs:38 :5
56
56
|
57
57
LL | / match None::<()> {
58
58
LL | | Some(_) => false,
@@ -61,7 +61,7 @@ LL | | };
61
61
| |_____^ help: try this: `None::<()>.is_none()`
62
62
63
63
error: redundant pattern matching, consider using `is_none()`
64
- --> $DIR/redundant_pattern_matching_option.rs:49 :13
64
+ --> $DIR/redundant_pattern_matching_option.rs:43 :13
65
65
|
66
66
LL | let _ = match None::<()> {
67
67
| _____________^
@@ -71,49 +71,49 @@ LL | | };
71
71
| |_____^ help: try this: `None::<()>.is_none()`
72
72
73
73
error: redundant pattern matching, consider using `is_some()`
74
- --> $DIR/redundant_pattern_matching_option.rs:55 :20
74
+ --> $DIR/redundant_pattern_matching_option.rs:49 :20
75
75
|
76
76
LL | let x = if let Some(_) = opt { true } else { false };
77
77
| -------^^^^^^^------ help: try this: `if opt.is_some()`
78
78
79
79
error: redundant pattern matching, consider using `is_some()`
80
- --> $DIR/redundant_pattern_matching_option.rs:60 :20
80
+ --> $DIR/redundant_pattern_matching_option.rs:54 :20
81
81
|
82
82
LL | let _ = if let Some(_) = gen_opt() {
83
83
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
84
84
85
85
error: redundant pattern matching, consider using `is_none()`
86
- --> $DIR/redundant_pattern_matching_option.rs:62 :19
86
+ --> $DIR/redundant_pattern_matching_option.rs:56 :19
87
87
|
88
88
LL | } else if let None = gen_opt() {
89
89
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
90
90
91
91
error: redundant pattern matching, consider using `is_some()`
92
- --> $DIR/redundant_pattern_matching_option.rs:83 :12
92
+ --> $DIR/redundant_pattern_matching_option.rs:77 :12
93
93
|
94
94
LL | if let Some(_) = Some(42) {}
95
95
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
96
96
97
97
error: redundant pattern matching, consider using `is_none()`
98
- --> $DIR/redundant_pattern_matching_option.rs:85 :12
98
+ --> $DIR/redundant_pattern_matching_option.rs:79 :12
99
99
|
100
100
LL | if let None = None::<()> {}
101
101
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
102
102
103
103
error: redundant pattern matching, consider using `is_some()`
104
- --> $DIR/redundant_pattern_matching_option.rs:87 :15
104
+ --> $DIR/redundant_pattern_matching_option.rs:81 :15
105
105
|
106
106
LL | while let Some(_) = Some(42) {}
107
107
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
108
108
109
109
error: redundant pattern matching, consider using `is_none()`
110
- --> $DIR/redundant_pattern_matching_option.rs:89 :15
110
+ --> $DIR/redundant_pattern_matching_option.rs:83 :15
111
111
|
112
112
LL | while let None = None::<()> {}
113
113
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
114
114
115
115
error: redundant pattern matching, consider using `is_some()`
116
- --> $DIR/redundant_pattern_matching_option.rs:91 :5
116
+ --> $DIR/redundant_pattern_matching_option.rs:85 :5
117
117
|
118
118
LL | / match Some(42) {
119
119
LL | | Some(_) => true,
@@ -122,7 +122,7 @@ LL | | };
122
122
| |_____^ help: try this: `Some(42).is_some()`
123
123
124
124
error: redundant pattern matching, consider using `is_none()`
125
- --> $DIR/redundant_pattern_matching_option.rs:96 :5
125
+ --> $DIR/redundant_pattern_matching_option.rs:90 :5
126
126
|
127
127
LL | / match None::<()> {
128
128
LL | | Some(_) => false,
0 commit comments