mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Small refactor
This commit is contained in:
parent
e4bdc14951
commit
ddd811601e
@ -48,11 +48,11 @@ impl SyntaxTreeBuilder {
|
||||
|
||||
pub fn finish(self) -> Parse<SyntaxNode> {
|
||||
let (green, errors) = self.finish_raw();
|
||||
let node = SyntaxNode::new_root(green);
|
||||
if cfg!(debug_assertions) {
|
||||
let node = SyntaxNode::new_root(green.clone());
|
||||
crate::validation::validate_block_structure(&node);
|
||||
}
|
||||
Parse::new(node.green().clone(), errors)
|
||||
Parse::new(green, errors)
|
||||
}
|
||||
|
||||
pub fn token(&mut self, kind: SyntaxKind, text: SmolStr) {
|
||||
|
Loading…
Reference in New Issue
Block a user