1
1
error: this `map_or` can be simplified
2
- --> tests/ui/unnecessary_map_or.rs:12 :13
2
+ --> tests/ui/unnecessary_map_or.rs:13 :13
3
3
|
4
4
LL | let _ = Some(5).map_or(false, |n| n == 5);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `( Some(5) == Some(5) )`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `Some(5) == Some(5)`
6
6
|
7
7
= note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
8
8
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
9
9
10
10
error: this `map_or` can be simplified
11
- --> tests/ui/unnecessary_map_or.rs:13 :13
11
+ --> tests/ui/unnecessary_map_or.rs:14 :13
12
12
|
13
13
LL | let _ = Some(5).map_or(true, |n| n != 5);
14
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `( Some(5) != Some(5) )`
14
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `Some(5) != Some(5)`
15
15
16
16
error: this `map_or` can be simplified
17
- --> tests/ui/unnecessary_map_or.rs:14 :13
17
+ --> tests/ui/unnecessary_map_or.rs:15 :13
18
18
|
19
19
LL | let _ = Some(5).map_or(false, |n| {
20
20
| _____________^
21
21
LL | | let _ = 1;
22
22
LL | | n == 5
23
23
LL | | });
24
- | |______^ help: use a standard comparison instead: `( Some(5) == Some(5) )`
24
+ | |______^ help: use a standard comparison instead: `Some(5) == Some(5)`
25
25
26
26
error: this `map_or` can be simplified
27
- --> tests/ui/unnecessary_map_or.rs:18 :13
27
+ --> tests/ui/unnecessary_map_or.rs:19 :13
28
28
|
29
29
LL | let _ = Some(5).map_or(false, |n| {
30
30
| _____________^
@@ -42,88 +42,106 @@ LL ~ });
42
42
|
43
43
44
44
error: this `map_or` can be simplified
45
- --> tests/ui/unnecessary_map_or.rs:22 :13
45
+ --> tests/ui/unnecessary_map_or.rs:23 :13
46
46
|
47
47
LL | let _ = Some(vec![5]).map_or(false, |n| n == [5]);
48
48
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(vec![5]).is_some_and(|n| n == [5])`
49
49
50
50
error: this `map_or` can be simplified
51
- --> tests/ui/unnecessary_map_or.rs:23 :13
51
+ --> tests/ui/unnecessary_map_or.rs:24 :13
52
52
|
53
53
LL | let _ = Some(vec![1]).map_or(false, |n| vec![2] == n);
54
54
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(vec![1]).is_some_and(|n| vec![2] == n)`
55
55
56
56
error: this `map_or` can be simplified
57
- --> tests/ui/unnecessary_map_or.rs:24 :13
57
+ --> tests/ui/unnecessary_map_or.rs:25 :13
58
58
|
59
59
LL | let _ = Some(5).map_or(false, |n| n == n);
60
60
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(|n| n == n)`
61
61
62
62
error: this `map_or` can be simplified
63
- --> tests/ui/unnecessary_map_or.rs:25 :13
63
+ --> tests/ui/unnecessary_map_or.rs:26 :13
64
64
|
65
65
LL | let _ = Some(5).map_or(false, |n| n == if 2 > 1 { n } else { 0 });
66
66
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(|n| n == if 2 > 1 { n } else { 0 })`
67
67
68
68
error: this `map_or` can be simplified
69
- --> tests/ui/unnecessary_map_or.rs:26 :13
69
+ --> tests/ui/unnecessary_map_or.rs:27 :13
70
70
|
71
71
LL | let _ = Ok::<Vec<i32>, i32>(vec![5]).map_or(false, |n| n == [5]);
72
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `Ok::<Vec<i32>, i32>(vec![5]).is_ok_and(|n| n == [5])`
73
73
74
74
error: this `map_or` can be simplified
75
- --> tests/ui/unnecessary_map_or.rs:27 :13
75
+ --> tests/ui/unnecessary_map_or.rs:28 :13
76
76
|
77
77
LL | let _ = Ok::<i32, i32>(5).map_or(false, |n| n == 5);
78
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `( Ok::<i32, i32>(5) == Ok(5) )`
78
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `Ok::<i32, i32>(5) == Ok(5)`
79
79
80
80
error: this `map_or` can be simplified
81
- --> tests/ui/unnecessary_map_or.rs:28 :13
81
+ --> tests/ui/unnecessary_map_or.rs:29 :13
82
82
|
83
83
LL | let _ = Some(5).map_or(false, |n| n == 5).then(|| 1);
84
84
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Some(5) == Some(5))`
85
85
86
86
error: this `map_or` can be simplified
87
- --> tests/ui/unnecessary_map_or.rs:29 :13
87
+ --> tests/ui/unnecessary_map_or.rs:30 :13
88
88
|
89
89
LL | let _ = Some(5).map_or(true, |n| n == 5);
90
90
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(|n| n == 5)`
91
91
92
92
error: this `map_or` can be simplified
93
- --> tests/ui/unnecessary_map_or.rs:30 :13
93
+ --> tests/ui/unnecessary_map_or.rs:31 :13
94
94
|
95
95
LL | let _ = Some(5).map_or(true, |n| 5 == n);
96
96
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(|n| 5 == n)`
97
97
98
98
error: this `map_or` can be simplified
99
- --> tests/ui/unnecessary_map_or.rs:54:13
99
+ --> tests/ui/unnecessary_map_or.rs:32:14
100
+ |
101
+ LL | let _ = !Some(5).map_or(false, |n| n == 5);
102
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Some(5) == Some(5))`
103
+
104
+ error: this `map_or` can be simplified
105
+ --> tests/ui/unnecessary_map_or.rs:33:13
106
+ |
107
+ LL | let _ = Some(5).map_or(false, |n| n == 5) || false;
108
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Some(5) == Some(5))`
109
+
110
+ error: this `map_or` can be simplified
111
+ --> tests/ui/unnecessary_map_or.rs:34:13
112
+ |
113
+ LL | let _ = Some(5).map_or(false, |n| n == 5) as usize;
114
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Some(5) == Some(5))`
115
+
116
+ error: this `map_or` can be simplified
117
+ --> tests/ui/unnecessary_map_or.rs:58:13
100
118
|
101
119
LL | let _ = r.map_or(false, |x| x == 7);
102
120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `r.is_ok_and(|x| x == 7)`
103
121
104
122
error: this `map_or` can be simplified
105
- --> tests/ui/unnecessary_map_or.rs:59 :13
123
+ --> tests/ui/unnecessary_map_or.rs:63 :13
106
124
|
107
125
LL | let _ = r.map_or(false, func);
108
126
| ^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `r.is_ok_and(func)`
109
127
110
128
error: this `map_or` can be simplified
111
- --> tests/ui/unnecessary_map_or.rs:60 :13
129
+ --> tests/ui/unnecessary_map_or.rs:64 :13
112
130
|
113
131
LL | let _ = Some(5).map_or(false, func);
114
132
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(func)`
115
133
116
134
error: this `map_or` can be simplified
117
- --> tests/ui/unnecessary_map_or.rs:61 :13
135
+ --> tests/ui/unnecessary_map_or.rs:65 :13
118
136
|
119
137
LL | let _ = Some(5).map_or(true, func);
120
138
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(func)`
121
139
122
140
error: this `map_or` can be simplified
123
- --> tests/ui/unnecessary_map_or.rs:66 :13
141
+ --> tests/ui/unnecessary_map_or.rs:70 :13
124
142
|
125
143
LL | let _ = r.map_or(false, |x| x == 8);
126
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `( r == Ok(8) )`
144
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `r == Ok(8)`
127
145
128
- error: aborting due to 18 previous errors
146
+ error: aborting due to 21 previous errors
129
147
0 commit comments