mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 05:03:21 +00:00
Account for let_chains in collapsible_if ui test cases.
This commit is contained in:
parent
b918594369
commit
6ef8b57e34
2 changed files with 42 additions and 0 deletions
|
@ -172,4 +172,25 @@ else {
|
|||
println!("Hello world!");
|
||||
}
|
||||
}
|
||||
|
||||
// Test behavior wrt. `let_chains`.
|
||||
// None of the cases below should be collapsed.
|
||||
fn truth() -> bool { true }
|
||||
|
||||
// Prefix:
|
||||
if let 0 = 1 {
|
||||
if truth() {}
|
||||
}
|
||||
|
||||
// Suffix:
|
||||
if truth() {
|
||||
if let 0 = 1 {}
|
||||
}
|
||||
|
||||
// Midfix:
|
||||
if truth() {
|
||||
if let 0 = 1 {
|
||||
if truth() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,4 +200,25 @@ fn main() {
|
|||
println!("Hello world!");
|
||||
}
|
||||
}
|
||||
|
||||
// Test behavior wrt. `let_chains`.
|
||||
// None of the cases below should be collapsed.
|
||||
fn truth() -> bool { true }
|
||||
|
||||
// Prefix:
|
||||
if let 0 = 1 {
|
||||
if truth() {}
|
||||
}
|
||||
|
||||
// Suffix:
|
||||
if truth() {
|
||||
if let 0 = 1 {}
|
||||
}
|
||||
|
||||
// Midfix:
|
||||
if truth() {
|
||||
if let 0 = 1 {
|
||||
if truth() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue