1- error: this `map_or` is redundant
1+ error: this `map_or` can be simplified
22 --> tests/ui/unnecessary_map_or.rs:12:13
33 |
44LL | let _ = Some(5).map_or(false, |n| n == 5);
@@ -7,13 +7,13 @@ LL | let _ = Some(5).map_or(false, |n| n == 5);
77 = note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
99
10- error: this `map_or` is redundant
10+ error: this `map_or` can be simplified
1111 --> tests/ui/unnecessary_map_or.rs:13:13
1212 |
1313LL | let _ = Some(5).map_or(true, |n| n != 5);
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Some(5) != Some(5))`
1515
16- error: this `map_or` is redundant
16+ error: this `map_or` can be simplified
1717 --> tests/ui/unnecessary_map_or.rs:14:13
1818 |
1919LL | let _ = Some(5).map_or(false, |n| {
@@ -23,7 +23,7 @@ LL | | n == 5
2323LL | | });
2424 | |______^ help: use a standard comparison instead: `(Some(5) == Some(5))`
2525
26- error: this `map_or` is redundant
26+ error: this `map_or` can be simplified
2727 --> tests/ui/unnecessary_map_or.rs:18:13
2828 |
2929LL | let _ = Some(5).map_or(false, |n| {
@@ -41,85 +41,85 @@ LL + 6 >= 5
4141LL ~ });
4242 |
4343
44- error: this `map_or` is redundant
44+ error: this `map_or` can be simplified
4545 --> tests/ui/unnecessary_map_or.rs:22: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
50- error: this `map_or` is redundant
50+ error: this `map_or` can be simplified
5151 --> tests/ui/unnecessary_map_or.rs:23: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
56- error: this `map_or` is redundant
56+ error: this `map_or` can be simplified
5757 --> tests/ui/unnecessary_map_or.rs:24: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
62- error: this `map_or` is redundant
62+ error: this `map_or` can be simplified
6363 --> tests/ui/unnecessary_map_or.rs:25: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
68- error: this `map_or` is redundant
68+ error: this `map_or` can be simplified
6969 --> tests/ui/unnecessary_map_or.rs:26: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
74- error: this `map_or` is redundant
74+ error: this `map_or` can be simplified
7575 --> tests/ui/unnecessary_map_or.rs:27:13
7676 |
7777LL | let _ = Ok::<i32, i32>(5).map_or(false, |n| n == 5);
7878 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(Ok::<i32, i32>(5) == Ok(5))`
7979
80- error: this `map_or` is redundant
80+ error: this `map_or` can be simplified
8181 --> tests/ui/unnecessary_map_or.rs:28: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
86- error: this `map_or` is redundant
86+ error: this `map_or` can be simplified
8787 --> tests/ui/unnecessary_map_or.rs:29: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
92- error: this `map_or` is redundant
92+ error: this `map_or` can be simplified
9393 --> tests/ui/unnecessary_map_or.rs:30: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
98- error: this `map_or` is redundant
98+ error: this `map_or` can be simplified
9999 --> tests/ui/unnecessary_map_or.rs:54:13
100100 |
101101LL | let _ = r.map_or(false, |x| x == 7);
102102 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `r.is_ok_and(|x| x == 7)`
103103
104- error: this `map_or` is redundant
104+ error: this `map_or` can be simplified
105105 --> tests/ui/unnecessary_map_or.rs:59:13
106106 |
107107LL | let _ = r.map_or(false, func);
108108 | ^^^^^^^^^^^^^^^^^^^^^ help: use is_ok_and instead: `r.is_ok_and(func)`
109109
110- error: this `map_or` is redundant
110+ error: this `map_or` can be simplified
111111 --> tests/ui/unnecessary_map_or.rs:60:13
112112 |
113113LL | let _ = Some(5).map_or(false, func);
114114 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_some_and instead: `Some(5).is_some_and(func)`
115115
116- error: this `map_or` is redundant
116+ error: this `map_or` can be simplified
117117 --> tests/ui/unnecessary_map_or.rs:61:13
118118 |
119119LL | let _ = Some(5).map_or(true, func);
120120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `Some(5).is_none_or(func)`
121121
122- error: this `map_or` is redundant
122+ error: this `map_or` can be simplified
123123 --> tests/ui/unnecessary_map_or.rs:66:13
124124 |
125125LL | let _ = r.map_or(false, |x| x == 8);
0 commit comments