mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
11 lines
380 B
Plaintext
11 lines
380 B
Plaintext
error: use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`
|
|
--> $DIR/obfuscated_if_else.rs:6:5
|
|
|
|
|
LL | true.then_some("a").unwrap_or("b");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if true { "a" } else { "b" }`
|
|
|
|
|
= note: `-D clippy::obfuscated-if-else` implied by `-D warnings`
|
|
|
|
error: aborting due to previous error
|
|
|