This commit is contained in:
l1nxy 2024-01-01 22:31:04 +08:00
parent b6a14ce5b8
commit a3be52cbc0

View File

@ -39,12 +39,13 @@ pub(crate) fn merge_nested_if(acc: &mut Assists, ctx: &AssistContext<'_>) -> Opt
}
let cond = expr.condition()?;
let cond_range = cond.syntax().text_range();
//should not apply for if-let
if is_pattern_cond(cond.clone()) {
return None;
}
let cond_range = cond.syntax().text_range();
//check if the then branch is a nested if
let then_branch = expr.then_branch()?;
let stmt = then_branch.stmt_list()?;