mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
c2c73189c8
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
11 lines
462 B
Text
11 lines
462 B
Text
error: use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`
|
|
--> $DIR/obfuscated_if_else.rs:4: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`
|
|
= help: to override `-D warnings` add `#[allow(clippy::obfuscated_if_else)]`
|
|
|
|
error: aborting due to 1 previous error
|
|
|