rust-clippy/tests/ui/obfuscated_if_else.stderr

11 lines
380 B
Text
Raw Normal View History

error: use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`
2023-07-27 11:40:22 +00:00
--> $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`
error: aborting due to previous error