Skip to content

Commit

Permalink
tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
l1nxy committed Jan 1, 2024
1 parent b6a14ce commit a3be52c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/ide-assists/src/handlers/merge_nested_if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down

0 comments on commit a3be52c

Please sign in to comment.