mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 22:24:14 +00:00
minor: remove dead code
This commit is contained in:
parent
1ee12b5db1
commit
8a7904127d
1 changed files with 1 additions and 11 deletions
|
@ -665,18 +665,8 @@ pub trait AstNodeEdit: AstNode + Clone + Sized {
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn replace_descendant<D: AstNode>(&self, old: D, new: D) -> Self {
|
fn replace_descendant<D: AstNode>(&self, old: D, new: D) -> Self {
|
||||||
self.replace_descendants(iter::once((old, new)))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[must_use]
|
|
||||||
fn replace_descendants<D: AstNode>(
|
|
||||||
&self,
|
|
||||||
replacement_map: impl IntoIterator<Item = (D, D)>,
|
|
||||||
) -> Self {
|
|
||||||
let mut rewriter = SyntaxRewriter::default();
|
let mut rewriter = SyntaxRewriter::default();
|
||||||
for (from, to) in replacement_map {
|
rewriter.replace(old.syntax(), new.syntax());
|
||||||
rewriter.replace(from.syntax(), to.syntax())
|
|
||||||
}
|
|
||||||
rewriter.rewrite_ast(self)
|
rewriter.rewrite_ast(self)
|
||||||
}
|
}
|
||||||
fn indent_level(&self) -> IndentLevel {
|
fn indent_level(&self) -> IndentLevel {
|
||||||
|
|
Loading…
Reference in a new issue