1
1
error: use Option::map_or instead of an if let/else
2
- --> $DIR/option_if_let_else.rs:6 :5
2
+ --> $DIR/option_if_let_else.rs:7 :5
3
3
|
4
4
LL | / if let Some(x) = string {
5
5
LL | | (true, x)
@@ -11,7 +11,7 @@ LL | | }
11
11
= note: `-D clippy::option-if-let-else` implied by `-D warnings`
12
12
13
13
error: use Option::map_or instead of an if let/else
14
- --> $DIR/option_if_let_else.rs:16 :12
14
+ --> $DIR/option_if_let_else.rs:17 :12
15
15
|
16
16
LL | } else if let Some(x) = string {
17
17
| ____________^
@@ -22,19 +22,19 @@ LL | | }
22
22
| |_____^ help: try: `{ string.map_or(Some((false, "")), |x| Some((true, x))) }`
23
23
24
24
error: use Option::map_or instead of an if let/else
25
- --> $DIR/option_if_let_else.rs:24 :13
25
+ --> $DIR/option_if_let_else.rs:25 :13
26
26
|
27
27
LL | let _ = if let Some(s) = *string { s.len() } else { 0 };
28
28
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `string.map_or(0, |s| s.len())`
29
29
30
30
error: use Option::map_or instead of an if let/else
31
- --> $DIR/option_if_let_else.rs:25 :13
31
+ --> $DIR/option_if_let_else.rs:26 :13
32
32
|
33
33
LL | let _ = if let Some(s) = &num { s } else { &0 };
34
34
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.as_ref().map_or(&0, |s| s)`
35
35
36
36
error: use Option::map_or instead of an if let/else
37
- --> $DIR/option_if_let_else.rs:26 :13
37
+ --> $DIR/option_if_let_else.rs:27 :13
38
38
|
39
39
LL | let _ = if let Some(s) = &mut num {
40
40
| _____________^
@@ -54,13 +54,13 @@ LL | });
54
54
|
55
55
56
56
error: use Option::map_or instead of an if let/else
57
- --> $DIR/option_if_let_else.rs:32 :13
57
+ --> $DIR/option_if_let_else.rs:33 :13
58
58
|
59
59
LL | let _ = if let Some(ref s) = num { s } else { &0 };
60
60
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.as_ref().map_or(&0, |s| s)`
61
61
62
62
error: use Option::map_or instead of an if let/else
63
- --> $DIR/option_if_let_else.rs:33 :13
63
+ --> $DIR/option_if_let_else.rs:34 :13
64
64
|
65
65
LL | let _ = if let Some(mut s) = num {
66
66
| _____________^
@@ -80,7 +80,7 @@ LL | });
80
80
|
81
81
82
82
error: use Option::map_or instead of an if let/else
83
- --> $DIR/option_if_let_else.rs:39 :13
83
+ --> $DIR/option_if_let_else.rs:40 :13
84
84
|
85
85
LL | let _ = if let Some(ref mut s) = num {
86
86
| _____________^
@@ -100,7 +100,7 @@ LL | });
100
100
|
101
101
102
102
error: use Option::map_or instead of an if let/else
103
- --> $DIR/option_if_let_else.rs:48 :5
103
+ --> $DIR/option_if_let_else.rs:49 :5
104
104
|
105
105
LL | / if let Some(x) = arg {
106
106
LL | | let y = x * x;
@@ -119,7 +119,7 @@ LL | })
119
119
|
120
120
121
121
error: use Option::map_or_else instead of an if let/else
122
- --> $DIR/option_if_let_else.rs:61 :13
122
+ --> $DIR/option_if_let_else.rs:62 :13
123
123
|
124
124
LL | let _ = if let Some(x) = arg {
125
125
| _____________^
@@ -131,7 +131,7 @@ LL | | };
131
131
| |_____^ help: try: `arg.map_or_else(|| side_effect(), |x| x)`
132
132
133
133
error: use Option::map_or_else instead of an if let/else
134
- --> $DIR/option_if_let_else.rs:70 :13
134
+ --> $DIR/option_if_let_else.rs:71 :13
135
135
|
136
136
LL | let _ = if let Some(x) = arg {
137
137
| _____________^
@@ -154,7 +154,7 @@ LL | }, |x| x * x * x * x);
154
154
|
155
155
156
156
error: use Option::map_or instead of an if let/else
157
- --> $DIR/option_if_let_else.rs:99 :13
157
+ --> $DIR/option_if_let_else.rs:100 :13
158
158
|
159
159
LL | let _ = if let Some(x) = optional { x + 2 } else { 5 };
160
160
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `optional.map_or(5, |x| x + 2)`
0 commit comments