@@ -8,31 +8,31 @@ LL | true.then_some("a").unwrap_or("b");
8
8
= help: to override `-D warnings` add `#[allow(clippy::obfuscated_if_else)]`
9
9
10
10
error: this method chain can be written more clearly with `if .. else ..`
11
- --> tests/ui/obfuscated_if_else.rs:6 :5
11
+ --> tests/ui/obfuscated_if_else.rs:7 :5
12
12
|
13
13
LL | true.then(|| "a").unwrap_or("b");
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { "a" } else { "b" }`
15
15
16
16
error: this method chain can be written more clearly with `if .. else ..`
17
- --> tests/ui/obfuscated_if_else.rs:9 :5
17
+ --> tests/ui/obfuscated_if_else.rs:11 :5
18
18
|
19
19
LL | (a == 1).then_some("a").unwrap_or("b");
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if a == 1 { "a" } else { "b" }`
21
21
22
22
error: this method chain can be written more clearly with `if .. else ..`
23
- --> tests/ui/obfuscated_if_else.rs:10 :5
23
+ --> tests/ui/obfuscated_if_else.rs:13 :5
24
24
|
25
25
LL | (a == 1).then(|| "a").unwrap_or("b");
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if a == 1 { "a" } else { "b" }`
27
27
28
28
error: this method chain can be written more clearly with `if .. else ..`
29
- --> tests/ui/obfuscated_if_else.rs:16 :5
29
+ --> tests/ui/obfuscated_if_else.rs:20 :5
30
30
|
31
31
LL | true.then_some(a += 1).unwrap_or(());
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { a += 1 } else { () }`
33
33
34
34
error: this method chain can be written more clearly with `if .. else ..`
35
- --> tests/ui/obfuscated_if_else.rs:17 :5
35
+ --> tests/ui/obfuscated_if_else.rs:22 :5
36
36
|
37
37
LL | true.then_some(()).unwrap_or(a += 2);
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { () } else { a += 2 }`
0 commit comments