diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_syntax/src/syntax_node.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index e566af7e8..9650b8781 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs | |||
@@ -48,11 +48,11 @@ impl SyntaxTreeBuilder { | |||
48 | 48 | ||
49 | pub fn finish(self) -> Parse<SyntaxNode> { | 49 | pub fn finish(self) -> Parse<SyntaxNode> { |
50 | let (green, errors) = self.finish_raw(); | 50 | let (green, errors) = self.finish_raw(); |
51 | let node = SyntaxNode::new_root(green); | ||
52 | if cfg!(debug_assertions) { | 51 | if cfg!(debug_assertions) { |
52 | let node = SyntaxNode::new_root(green.clone()); | ||
53 | crate::validation::validate_block_structure(&node); | 53 | crate::validation::validate_block_structure(&node); |
54 | } | 54 | } |
55 | Parse::new(node.green().clone(), errors) | 55 | Parse::new(green, errors) |
56 | } | 56 | } |
57 | 57 | ||
58 | pub fn token(&mut self, kind: SyntaxKind, text: SmolStr) { | 58 | pub fn token(&mut self, kind: SyntaxKind, text: SmolStr) { |