File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -172,4 +172,25 @@ else {
172172 println!("Hello world!");
173173 }
174174 }
175+
176+ // Test behavior wrt. `let_chains`.
177+ // None of the cases below should be collapsed.
178+ fn truth() -> bool { true }
179+
180+ // Prefix:
181+ if let 0 = 1 {
182+ if truth() {}
183+ }
184+
185+ // Suffix:
186+ if truth() {
187+ if let 0 = 1 {}
188+ }
189+
190+ // Midfix:
191+ if truth() {
192+ if let 0 = 1 {
193+ if truth() {}
194+ }
195+ }
175196}
Original file line number Diff line number Diff line change @@ -200,4 +200,25 @@ fn main() {
200200 println ! ( "Hello world!" ) ;
201201 }
202202 }
203+
204+ // Test behavior wrt. `let_chains`.
205+ // None of the cases below should be collapsed.
206+ fn truth ( ) -> bool { true }
207+
208+ // Prefix:
209+ if let 0 = 1 {
210+ if truth ( ) { }
211+ }
212+
213+ // Suffix:
214+ if truth ( ) {
215+ if let 0 = 1 { }
216+ }
217+
218+ // Midfix:
219+ if truth ( ) {
220+ if let 0 = 1 {
221+ if truth ( ) { }
222+ }
223+ }
203224}
You can’t perform that action at this time.
0 commit comments