11error: 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
33 |
44LL | / if let Some(x) = string {
55LL | | (true, x)
@@ -11,7 +11,7 @@ LL | | }
1111 = note: `-D clippy::option-if-let-else` implied by `-D warnings`
1212
1313error: 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
1515 |
1616LL | } else if let Some(x) = string {
1717 | ____________^
@@ -22,19 +22,19 @@ LL | | }
2222 | |_____^ help: try: `{ string.map_or(Some((false, "")), |x| Some((true, x))) }`
2323
2424error: 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
2626 |
2727LL | let _ = if let Some(s) = *string { s.len() } else { 0 };
2828 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `string.map_or(0, |s| s.len())`
2929
3030error: 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
3232 |
3333LL | let _ = if let Some(s) = &num { s } else { &0 };
3434 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.as_ref().map_or(&0, |s| s)`
3535
3636error: 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
3838 |
3939LL | let _ = if let Some(s) = &mut num {
4040 | _____________^
@@ -54,13 +54,13 @@ LL | });
5454 |
5555
5656error: 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
5858 |
5959LL | let _ = if let Some(ref s) = num { s } else { &0 };
6060 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.as_ref().map_or(&0, |s| s)`
6161
6262error: 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
6464 |
6565LL | let _ = if let Some(mut s) = num {
6666 | _____________^
@@ -80,7 +80,7 @@ LL | });
8080 |
8181
8282error: 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
8484 |
8585LL | let _ = if let Some(ref mut s) = num {
8686 | _____________^
@@ -100,7 +100,7 @@ LL | });
100100 |
101101
102102error: 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
104104 |
105105LL | / if let Some(x) = arg {
106106LL | | let y = x * x;
@@ -119,7 +119,7 @@ LL | })
119119 |
120120
121121error: 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
123123 |
124124LL | let _ = if let Some(x) = arg {
125125 | _____________^
@@ -131,7 +131,7 @@ LL | | };
131131 | |_____^ help: try: `arg.map_or_else(|| side_effect(), |x| x)`
132132
133133error: 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
135135 |
136136LL | let _ = if let Some(x) = arg {
137137 | _____________^
@@ -154,7 +154,7 @@ LL | }, |x| x * x * x * x);
154154 |
155155
156156error: 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
158158 |
159159LL | let _ = if let Some(x) = optional { x + 2 } else { 5 };
160160 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `optional.map_or(5, |x| x + 2)`
0 commit comments