diff options
| author | Martin Haug <mhaug@live.de> | 2021-10-31 11:46:12 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2021-11-05 13:44:49 +0100 |
| commit | 84d35efee38d137a77e368c50421ac24327371c6 (patch) | |
| tree | c2fa9f669743d35cbb79892770427dd843202894 /src/source.rs | |
| parent | 4875633acf4701705b9b3b014eb7d94268b897c2 (diff) | |
Less owning, more iterating
Diffstat (limited to 'src/source.rs')
| -rw-r--r-- | src/source.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Markup> { - 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(), |
