From deab4caa7b1ba81c1b7e6561bc270bbde6467f13 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 12 Jul 2019 19:41:13 +0300 Subject: make Parse fields private this is in preparation for the new rowan API --- crates/ra_syntax/src/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/lib.rs') diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 9790a984d..06d3ea727 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -59,11 +59,19 @@ pub use rowan::{SmolStr, TextRange, TextUnit}; /// files. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Parse { - pub tree: TreeArc, - pub errors: Arc>, + tree: TreeArc, + errors: Arc>, } impl Parse { + pub fn tree(&self) -> &SourceFile { + &*self.tree + } + + pub fn errors(&self) -> &[SyntaxError] { + &*self.errors + } + pub fn ok(self) -> Result, Arc>> { if self.errors.is_empty() { Ok(self.tree) -- cgit v1.2.3