Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/lib.rs')
-rw-r--r--crates/syntax/src/lib.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/syntax/src/lib.rs b/crates/syntax/src/lib.rs
index 132d300674..24a099cb3c 100644
--- a/crates/syntax/src/lib.rs
+++ b/crates/syntax/src/lib.rs
@@ -89,6 +89,9 @@ impl<T> Parse<T> {
pub fn syntax_node(&self) -> SyntaxNode {
SyntaxNode::new_root(self.green.clone())
}
+ pub fn errors(&self) -> &[SyntaxError] {
+ &*self.errors
+ }
}
impl<T: AstNode> Parse<T> {
@@ -100,10 +103,6 @@ impl<T: AstNode> Parse<T> {
T::cast(self.syntax_node()).unwrap()
}
- pub fn errors(&self) -> &[SyntaxError] {
- &*self.errors
- }
-
pub fn ok(self) -> Result<T, Arc<Vec<SyntaxError>>> {
if self.errors.is_empty() {
Ok(self.tree())