rust/tests/ui/if_then_some_else_none.stderr

32 lines
847 B
Plaintext
Raw Normal View History

error: this could be simplified with `bool::then`
--> $DIR/if_then_some_else_none.rs:6:13
|
LL | let _ = if foo() {
| _____________^
LL | | println!("true!");
LL | | Some("foo")
LL | | } else {
LL | | None
LL | | };
| |_____^
|
= note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
= help: consider using `bool::then` like: `foo().then(|| { /* snippet */ "foo" })`
error: this could be simplified with `bool::then`
--> $DIR/if_then_some_else_none.rs:66:13
|
LL | let _ = if foo() {
| _____________^
LL | | println!("true!");
LL | | Some(150)
LL | | } else {
LL | | None
LL | | };
| |_____^
|
= help: consider using `bool::then` like: `foo().then(|| { /* snippet */ 150 })`
error: aborting due to 2 previous errors