We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 304cdd7 + 8a79041 commit 4e33cbcCopy full SHA for 4e33cbc
crates/syntax/src/ast/edit.rs
@@ -665,18 +665,8 @@ pub trait AstNodeEdit: AstNode + Clone + Sized {
665
666
#[must_use]
667
fn replace_descendant<D: AstNode>(&self, old: D, new: D) -> Self {
668
- self.replace_descendants(iter::once((old, new)))
669
- }
670
-
671
- #[must_use]
672
- fn replace_descendants<D: AstNode>(
673
- &self,
674
- replacement_map: impl IntoIterator<Item = (D, D)>,
675
- ) -> Self {
676
let mut rewriter = SyntaxRewriter::default();
677
- for (from, to) in replacement_map {
678
- rewriter.replace(from.syntax(), to.syntax())
679
+ rewriter.replace(old.syntax(), new.syntax());
680
rewriter.rewrite_ast(self)
681
}
682
fn indent_level(&self) -> IndentLevel {
0 commit comments