11error: this could be simplified with `bool::then`
2- --> tests/ui/if_then_some_else_none.rs:6 :13
2+ --> tests/ui/if_then_some_else_none.rs:10 :13
33 |
44LL | let _ = if foo() {
55 | _____________^
@@ -24,7 +24,7 @@ LL ~ });
2424 |
2525
2626error: this could be simplified with `bool::then`
27- --> tests/ui/if_then_some_else_none.rs:16 :13
27+ --> tests/ui/if_then_some_else_none.rs:20 :13
2828 |
2929LL | let _ = if matches!(true, true) {
3030 | _____________^
@@ -47,19 +47,19 @@ LL ~ });
4747 |
4848
4949error: this could be simplified with `bool::then_some`
50- --> tests/ui/if_then_some_else_none.rs:27 :28
50+ --> tests/ui/if_then_some_else_none.rs:31 :28
5151 |
5252LL | let _ = x.and_then(|o| if o < 32 { Some(o) } else { None });
5353 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(o < 32).then_some(o)`
5454
5555error: this could be simplified with `bool::then_some`
56- --> tests/ui/if_then_some_else_none.rs:32 :13
56+ --> tests/ui/if_then_some_else_none.rs:36 :13
5757 |
5858LL | let _ = if !x { Some(0) } else { None };
5959 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(!x).then_some(0)`
6060
6161error: this could be simplified with `bool::then`
62- --> tests/ui/if_then_some_else_none.rs:88 :13
62+ --> tests/ui/if_then_some_else_none.rs:92 :13
6363 |
6464LL | let _ = if foo() {
6565 | _____________^
@@ -82,13 +82,13 @@ LL ~ });
8282 |
8383
8484error: this could be simplified with `bool::then`
85- --> tests/ui/if_then_some_else_none.rs:138 :5
85+ --> tests/ui/if_then_some_else_none.rs:142 :5
8686 |
8787LL | if s == "1" { Some(true) } else { None }
8888 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(s == "1").then(|| true)`
8989
9090error: this could be simplified with `bool::then`
91- --> tests/ui/if_then_some_else_none.rs:154 :9
91+ --> tests/ui/if_then_some_else_none.rs:158 :9
9292 |
9393LL | / if rs.len() == 1 && rs[0].start == rs[0].end {
9494LL | |
@@ -99,7 +99,7 @@ LL | | }
9999 | |_________^ help: try: `(rs.len() == 1 && rs[0].start == rs[0].end).then(|| vec![rs[0].start])`
100100
101101error: this could be simplified with `bool::then_some`
102- --> tests/ui/if_then_some_else_none.rs:164 :9
102+ --> tests/ui/if_then_some_else_none.rs:168 :9
103103 |
104104LL | / if modulo == 0 {
105105LL | |
@@ -110,7 +110,7 @@ LL | | }
110110 | |_________^ help: try: `(modulo == 0).then_some(i)`
111111
112112error: this could be simplified with `bool::then_some`
113- --> tests/ui/if_then_some_else_none.rs:181 :22
113+ --> tests/ui/if_then_some_else_none.rs:185 :22
114114 |
115115LL | do_something(if i % 2 == 0 {
116116 | ______________________^
@@ -122,7 +122,7 @@ LL | | });
122122 | |_________^ help: try: `(i % 2 == 0).then_some(item_fn)`
123123
124124error: this could be simplified with `bool::then_some`
125- --> tests/ui/if_then_some_else_none.rs:198 :22
125+ --> tests/ui/if_then_some_else_none.rs:202 :22
126126 |
127127LL | do_something(if i % 2 == 0 {
128128 | ______________________^
@@ -134,7 +134,7 @@ LL | | });
134134 | |_________^ help: try: `(i % 2 == 0).then_some(item_fn)`
135135
136136error: this could be simplified with `bool::then_some`
137- --> tests/ui/if_then_some_else_none.rs:206 :22
137+ --> tests/ui/if_then_some_else_none.rs:210 :22
138138 |
139139LL | do_something(if i % 2 == 0 {
140140 | ______________________^
@@ -146,7 +146,7 @@ LL | | });
146146 | |_________^ help: try: `(i % 2 == 0).then_some(closure_fn)`
147147
148148error: this could be simplified with `bool::then`
149- --> tests/ui/if_then_some_else_none.rs:231 :13
149+ --> tests/ui/if_then_some_else_none.rs:235 :13
150150 |
151151LL | / if self.count < 5 {
152152LL | | self.count += 1;
@@ -165,7 +165,7 @@ LL + })
165165 |
166166
167167error: this could be simplified with `bool::then`
168- --> tests/ui/if_then_some_else_none.rs:249 :13
168+ --> tests/ui/if_then_some_else_none.rs:253 :13
169169 |
170170LL | let _ = if true {
171171 | _____________^
@@ -185,7 +185,7 @@ LL ~ });
185185 |
186186
187187error: this could be simplified with `bool::then`
188- --> tests/ui/if_then_some_else_none.rs:292 :5
188+ --> tests/ui/if_then_some_else_none.rs:296 :5
189189 |
190190LL | / if 1 <= 3 {
191191LL | | let a = UnsafeCell::new(1);
0 commit comments