Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/handlers/convert_bool_then.rs')
| -rw-r--r-- | crates/ide_assists/src/handlers/convert_bool_then.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_assists/src/handlers/convert_bool_then.rs b/crates/ide_assists/src/handlers/convert_bool_then.rs index 0bf2abe493..274718e6ea 100644 --- a/crates/ide_assists/src/handlers/convert_bool_then.rs +++ b/crates/ide_assists/src/handlers/convert_bool_then.rs @@ -2,7 +2,7 @@ use hir::{known, AsAssocItem, Semantics}; use ide_db::{ helpers::{ for_each_tail_expr, - node_ext::{block_as_lone_tail, preorder_expr}, + node_ext::{block_as_lone_tail, is_pattern_cond, preorder_expr}, FamousDefs, }, RootDatabase, @@ -45,7 +45,7 @@ pub(crate) fn convert_if_to_bool_then(acc: &mut Assists, ctx: &AssistContext) -> return None; } - let cond = expr.condition().filter(|cond| !cond.is_pattern_cond())?; + let cond = expr.condition().filter(|cond| !is_pattern_cond(cond.clone()))?; let then = expr.then_branch()?; let else_ = match expr.else_branch()? { ast::ElseBranch::Block(b) => b, |