parent_node_is_if_expr now also recognizes if let as parent if

This commit is contained in:
xFrednet 2021-04-10 14:45:51 +02:00
parent b1c675f3fc
commit cbde4f2c67
3 changed files with 44 additions and 7 deletions

View file

@ -206,4 +206,18 @@ fn fp_test() {
}
}
fn fp_if_let_issue7054() {
// This shouldn't trigger the lint
let string;
let _x = if let true = true {
""
} else if true {
string = "x".to_owned();
&string
} else {
string = "y".to_owned();
&string
};
}
fn main() {}