rust-clippy/tests/ui/obfuscated_if_else.stderr
Ariel Uy 9ff7c91100 Add new lint obfuscated_if_else
New lint suggests using `if .. else ..` instead of
`.then_some(..).unwrap_or(..)`.
2022-07-17 18:44:49 -07:00

10 lines
380 B
Text

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