Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/remove_dbg.rs')
-rw-r--r--crates/ide-assists/src/handlers/remove_dbg.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ide-assists/src/handlers/remove_dbg.rs b/crates/ide-assists/src/handlers/remove_dbg.rs
index d56d85d12d..007dd91d1b 100644
--- a/crates/ide-assists/src/handlers/remove_dbg.rs
+++ b/crates/ide-assists/src/handlers/remove_dbg.rs
@@ -209,8 +209,7 @@ fn replace_nested_dbgs(expanded: ast::Expr) -> ast::Expr {
return replaced;
}
- let (mut editor, expanded) = SyntaxEditor::new(expanded.syntax().clone());
- let expanded = ast::Expr::cast(expanded).unwrap();
+ let (mut editor, expanded) = SyntaxEditor::new_typed(&expanded);
// We need to collect to avoid mutation during traversal.
let macro_exprs: Vec<_> =
expanded.syntax().descendants().filter_map(ast::MacroExpr::cast).collect();