1
1
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2
- --> $DIR/map_unwrap_or_default.rs:9 :17
2
+ --> $DIR/map_unwrap_or_default.rs:13 :17
3
3
|
4
4
LL | let _ = opt.map(|x| x > 1)
5
5
| _________________^
@@ -16,7 +16,7 @@ LL + let _ = opt.is_some_and(|x| x > 1);
16
16
|
17
17
18
18
error: called `map(<f>).unwrap_or_default()` on an `Option` value
19
- --> $DIR/map_unwrap_or_default.rs:13 :17
19
+ --> $DIR/map_unwrap_or_default.rs:17 :17
20
20
|
21
21
LL | let _ = opt.map(|x| {
22
22
| _________________^
@@ -34,7 +34,7 @@ LL ~ );
34
34
|
35
35
36
36
error: called `map(<f>).unwrap_or_default()` on an `Option` value
37
- --> $DIR/map_unwrap_or_default.rs:17 :17
37
+ --> $DIR/map_unwrap_or_default.rs:21 :17
38
38
|
39
39
LL | let _ = opt.map(|x| x > 1).unwrap_or_default();
40
40
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -46,7 +46,7 @@ LL + let _ = opt.is_some_and(|x| x > 1);
46
46
|
47
47
48
48
error: called `map(<f>).unwrap_or_default()` on an `Option` value
49
- --> $DIR/map_unwrap_or_default.rs:19 :10
49
+ --> $DIR/map_unwrap_or_default.rs:23 :10
50
50
|
51
51
LL | .map(|x| x > 1)
52
52
| __________^
@@ -59,8 +59,20 @@ LL - .map(|x| x > 1)
59
59
LL + .is_some_and(|x| x > 1);
60
60
|
61
61
62
+ error: called `map(<f>).unwrap_or_default()` on an `Option` value
63
+ --> $DIR/map_unwrap_or_default.rs:30:18
64
+ |
65
+ LL | let _ = opt2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
66
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67
+ |
68
+ help: use is_some_and instead
69
+ |
70
+ LL - let _ = opt2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
71
+ LL + let _ = opt2.is_some_and(char::is_alphanumeric); // should lint
72
+ |
73
+
62
74
error: called `map(<f>).unwrap_or_default()` on a `Result` value
63
- --> $DIR/map_unwrap_or_default.rs:31 :17
75
+ --> $DIR/map_unwrap_or_default.rs:39 :17
64
76
|
65
77
LL | let _ = res.map(|x| {
66
78
| _________________^
@@ -78,7 +90,7 @@ LL ~ );
78
90
|
79
91
80
92
error: called `map(<f>).unwrap_or_default()` on a `Result` value
81
- --> $DIR/map_unwrap_or_default.rs:35 :17
93
+ --> $DIR/map_unwrap_or_default.rs:43 :17
82
94
|
83
95
LL | let _ = res.map(|x| x > 1)
84
96
| _________________^
@@ -91,5 +103,17 @@ LL - let _ = res.map(|x| x > 1)
91
103
LL + let _ = res.is_ok_and(|x| x > 1);
92
104
|
93
105
94
- error: aborting due to 6 previous errors
106
+ error: called `map(<f>).unwrap_or_default()` on a `Result` value
107
+ --> $DIR/map_unwrap_or_default.rs:50:18
108
+ |
109
+ LL | let _ = res2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
110
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111
+ |
112
+ help: use is_ok_and instead
113
+ |
114
+ LL - let _ = res2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
115
+ LL + let _ = res2.is_ok_and(char::is_alphanumeric); // should lint
116
+ |
117
+
118
+ error: aborting due to 8 previous errors
95
119
0 commit comments