rust/tests/ui/if_then_some_else_none.stderr
2021-03-08 22:52:03 +09:00

29 lines
788 B
Plaintext

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 | | };
| |_____^ help: try this: `foo().then(|| { /* snippet */ "foo" })`
|
= note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
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("foo")
LL | | } else {
LL | | None
LL | | };
| |_____^ help: try this: `foo().then(|| { /* snippet */ "foo" })`
error: aborting due to 2 previous errors