11error: this `map_or` can be simplified
2- --> tests/ui/unnecessary_map_or.rs:12 :13
2+ --> tests/ui/unnecessary_map_or.rs:13 :13
33 |
44LL | 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)`
66 |
77 = note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
99
1010error: this `map_or` can be simplified
11- --> tests/ui/unnecessary_map_or.rs:13 :13
11+ --> tests/ui/unnecessary_map_or.rs:14 :13
1212 |
1313LL | 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)`
1515
1616error: this `map_or` can be simplified
17- --> tests/ui/unnecessary_map_or.rs:14 :13
17+ --> tests/ui/unnecessary_map_or.rs:15 :13
1818 |
1919LL | let _ = Some(5).map_or(false, |n| {
2020 | _____________^
2121LL | | let _ = 1;
2222LL | | n == 5
2323LL | | });
24- | |______^ help: use a standard comparison instead: `( Some(5) == Some(5) )`
24+ | |______^ help: use a standard comparison instead: `Some(5) == Some(5)`
2525
2626error: this `map_or` can be simplified
27- --> tests/ui/unnecessary_map_or.rs:18 :13
27+ --> tests/ui/unnecessary_map_or.rs:19 :13
2828 |
2929LL | let _ = Some(5).map_or(false, |n| {
3030 | _____________^
@@ -42,88 +42,106 @@ LL ~ });
4242 |
4343
4444error: this `map_or` can be simplified
45- --> tests/ui/unnecessary_map_or.rs:22 :13
45+ --> tests/ui/unnecessary_map_or.rs:23 :13
4646 |
4747LL | let _ = Some(vec![5]).map_or(false, |n| n == [5]);
4848 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(vec![5]).is_some_and(|n| n == [5])`
4949
5050error: this `map_or` can be simplified
51- --> tests/ui/unnecessary_map_or.rs:23 :13
51+ --> tests/ui/unnecessary_map_or.rs:24 :13
5252 |
5353LL | let _ = Some(vec![1]).map_or(false, |n| vec![2] == n);
5454 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(vec![1]).is_some_and(|n| vec![2] == n)`
5555
5656error: this `map_or` can be simplified
57- --> tests/ui/unnecessary_map_or.rs:24 :13
57+ --> tests/ui/unnecessary_map_or.rs:25 :13
5858 |
5959LL | let _ = Some(5).map_or(false, |n| n == n);
6060 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(|n| n == n)`
6161
6262error: this `map_or` can be simplified
63- --> tests/ui/unnecessary_map_or.rs:25 :13
63+ --> tests/ui/unnecessary_map_or.rs:26 :13
6464 |
6565LL | let _ = Some(5).map_or(false, |n| n == if 2 > 1 { n } else { 0 });
6666 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(|n| n == if 2 > 1 { n } else { 0 })`
6767
6868error: this `map_or` can be simplified
69- --> tests/ui/unnecessary_map_or.rs:26 :13
69+ --> tests/ui/unnecessary_map_or.rs:27 :13
7070 |
7171LL | let _ = Ok::<Vec<i32>, i32>(vec![5]).map_or(false, |n| n == [5]);
7272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `Ok::<Vec<i32>, i32>(vec![5]).is_ok_and(|n| n == [5])`
7373
7474error: this `map_or` can be simplified
75- --> tests/ui/unnecessary_map_or.rs:27 :13
75+ --> tests/ui/unnecessary_map_or.rs:28 :13
7676 |
7777LL | 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)`
7979
8080error: this `map_or` can be simplified
81- --> tests/ui/unnecessary_map_or.rs:28 :13
81+ --> tests/ui/unnecessary_map_or.rs:29 :13
8282 |
8383LL | let _ = Some(5).map_or(false, |n| n == 5).then(|| 1);
8484 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Some(5) == Some(5))`
8585
8686error: this `map_or` can be simplified
87- --> tests/ui/unnecessary_map_or.rs:29 :13
87+ --> tests/ui/unnecessary_map_or.rs:30 :13
8888 |
8989LL | let _ = Some(5).map_or(true, |n| n == 5);
9090 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(|n| n == 5)`
9191
9292error: this `map_or` can be simplified
93- --> tests/ui/unnecessary_map_or.rs:30 :13
93+ --> tests/ui/unnecessary_map_or.rs:31 :13
9494 |
9595LL | let _ = Some(5).map_or(true, |n| 5 == n);
9696 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(|n| 5 == n)`
9797
9898error: 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
100118 |
101119LL | let _ = r.map_or(false, |x| x == 7);
102120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `r.is_ok_and(|x| x == 7)`
103121
104122error: this `map_or` can be simplified
105- --> tests/ui/unnecessary_map_or.rs:59 :13
123+ --> tests/ui/unnecessary_map_or.rs:63 :13
106124 |
107125LL | let _ = r.map_or(false, func);
108126 | ^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `r.is_ok_and(func)`
109127
110128error: this `map_or` can be simplified
111- --> tests/ui/unnecessary_map_or.rs:60 :13
129+ --> tests/ui/unnecessary_map_or.rs:64 :13
112130 |
113131LL | let _ = Some(5).map_or(false, func);
114132 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(func)`
115133
116134error: this `map_or` can be simplified
117- --> tests/ui/unnecessary_map_or.rs:61 :13
135+ --> tests/ui/unnecessary_map_or.rs:65 :13
118136 |
119137LL | let _ = Some(5).map_or(true, func);
120138 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(func)`
121139
122140error: this `map_or` can be simplified
123- --> tests/ui/unnecessary_map_or.rs:66 :13
141+ --> tests/ui/unnecessary_map_or.rs:70 :13
124142 |
125143LL | 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)`
127145
128- error: aborting due to 18 previous errors
146+ error: aborting due to 21 previous errors
129147
0 commit comments