1 error: this could be simplified with `bool::then`
2 --> $DIR/if_then_some_else_none.rs:6:13
4 LL | let _ = if foo() {
6 LL | | println!("true!");
13 = help: consider using `bool::then` like: `foo().then(|| { /* snippet */ "foo" })`
14 = note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
16 error: this could be simplified with `bool::then`
17 --> $DIR/if_then_some_else_none.rs:14:13
19 LL | let _ = if matches!(true, true) {
21 LL | | println!("true!");
22 LL | | Some(matches!(true, false))
28 = help: consider using `bool::then` like: `matches!(true, true).then(|| { /* snippet */ matches!(true, false) })`
30 error: this could be simplified with `bool::then_some`
31 --> $DIR/if_then_some_else_none.rs:23:28
33 LL | let _ = x.and_then(|o| if o < 32 { Some(o) } else { None });
34 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 = help: consider using `bool::then_some` like: `(o < 32).then_some(o)`
38 error: this could be simplified with `bool::then_some`
39 --> $DIR/if_then_some_else_none.rs:27:13
41 LL | let _ = if !x { Some(0) } else { None };
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44 = help: consider using `bool::then_some` like: `(!x).then_some(0)`
46 error: this could be simplified with `bool::then`
47 --> $DIR/if_then_some_else_none.rs:82:13
49 LL | let _ = if foo() {
51 LL | | println!("true!");
58 = help: consider using `bool::then` like: `foo().then(|| { /* snippet */ 150 })`
60 error: aborting due to 5 previous errors