From 70097504f78c4c41368a0b864a94df95fb9c27f7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 17 Aug 2018 21:10:55 +0300 Subject: hide root --- crates/libsyntax2/src/ast/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/libsyntax2/src/ast/mod.rs') diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs index 9b9200f99..b52230e9c 100644 --- a/crates/libsyntax2/src/ast/mod.rs +++ b/crates/libsyntax2/src/ast/mod.rs @@ -1,12 +1,10 @@ mod generated; -use std::sync::Arc; - use itertools::Itertools; use smol_str::SmolStr; use { - SyntaxNode, SyntaxNodeRef, SyntaxRoot, TreeRoot, SyntaxError, + SyntaxNode, SyntaxNodeRef, OwnedRoot, TreeRoot, SyntaxError, SyntaxKind::*, }; pub use self::generated::*; @@ -37,7 +35,7 @@ pub trait AttrsOwner: AstNode { } } -impl File> { +impl File { pub fn parse(text: &str) -> Self { File::cast(::parse(text)).unwrap() } @@ -45,7 +43,7 @@ impl File> { impl File { pub fn errors(&self) -> Vec { - self.syntax().root.errors.clone() + self.syntax().root.syntax_root().errors.clone() } } -- cgit v1.2.3