4675: Small refactor r=kiljacken a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
This commit is contained in:
bors[bot] 2020-05-31 21:09:24 +00:00 committed by GitHub
commit 7ae247f03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {