From 8a7904127d3849daa57485b334343412f6a29c2e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 8 May 2021 23:28:36 +0300 Subject: [PATCH] minor: remove dead code --- crates/syntax/src/ast/edit.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index 8c60927e4fb..cbc75f92291 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs @@ -665,18 +665,8 @@ fn replace_children( #[must_use] fn replace_descendant(&self, old: D, new: D) -> Self { - self.replace_descendants(iter::once((old, new))) - } - - #[must_use] - fn replace_descendants( - &self, - replacement_map: impl IntoIterator, - ) -> Self { let mut rewriter = SyntaxRewriter::default(); - for (from, to) in replacement_map { - rewriter.replace(from.syntax(), to.syntax()) - } + rewriter.replace(old.syntax(), new.syntax()); rewriter.rewrite_ast(self) } fn indent_level(&self) -> IndentLevel {