From 84d35efee38d137a77e368c50421ac24327371c6 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Sun, 31 Oct 2021 11:46:12 +0100 Subject: Less owning, more iterating --- src/source.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/source.rs') diff --git a/src/source.rs b/src/source.rs index e33e146c..e3803f57 100644 --- a/src/source.rs +++ b/src/source.rs @@ -148,10 +148,10 @@ impl SourceFile { } pub fn ast(&self) -> TypResult { - let res = RedNode::new_root(self.root.clone(), self.id); - let errors = res.errors(); + let red = RedNode::new_root(self.root.clone(), self.id); + let errors = red.errors(); if errors.is_empty() { - Ok(res.ticket().cast().unwrap()) + Ok(red.as_ref().cast().unwrap()) } else { Err(Box::new( errors.into_iter().map(|(span, msg)| Error::new(span, msg)).collect(), -- cgit v1.2.3