From 4e142757e167ac16ce65ba1c743e131aba83cdc4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 16 May 2021 14:18:49 +0300 Subject: minor: use uniform names --- crates/ide_assists/src/assist_context.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide_assists/src/assist_context.rs') diff --git a/crates/ide_assists/src/assist_context.rs b/crates/ide_assists/src/assist_context.rs index 682f0ff5e..20754a02a 100644 --- a/crates/ide_assists/src/assist_context.rs +++ b/crates/ide_assists/src/assist_context.rs @@ -238,8 +238,8 @@ impl AssistBuilder { } } - pub(crate) fn make_ast_mut(&mut self, node: N) -> N { - N::cast(self.make_mut(node.syntax().clone())).unwrap() + pub(crate) fn make_mut(&mut self, node: N) -> N { + self.mutated_tree.get_or_insert_with(|| TreeMutator::new(node.syntax())).make_mut(&node) } /// Returns a copy of the `node`, suitable for mutation. /// @@ -251,7 +251,7 @@ impl AssistBuilder { /// The typical pattern for an assist is to find specific nodes in the read /// phase, and then get their mutable couterparts using `make_mut` in the /// mutable state. - pub(crate) fn make_mut(&mut self, node: SyntaxNode) -> SyntaxNode { + pub(crate) fn make_syntax_mut(&mut self, node: SyntaxNode) -> SyntaxNode { self.mutated_tree.get_or_insert_with(|| TreeMutator::new(&node)).make_syntax_mut(&node) } -- cgit v1.2.3