diff options
Diffstat (limited to 'src/yellow/syntax.rs')
-rw-r--r-- | src/yellow/syntax.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/yellow/syntax.rs b/src/yellow/syntax.rs index 41dcf3761..487a4ef1d 100644 --- a/src/yellow/syntax.rs +++ b/src/yellow/syntax.rs | |||
@@ -6,7 +6,7 @@ use { | |||
6 | TextRange, TextUnit, | 6 | TextRange, TextUnit, |
7 | }; | 7 | }; |
8 | 8 | ||
9 | pub trait TreeRoot: Deref<Target=SyntaxRoot> + Clone {} | 9 | pub trait TreeRoot: Deref<Target = SyntaxRoot> + Clone {} |
10 | 10 | ||
11 | impl TreeRoot for Arc<SyntaxRoot> {} | 11 | impl TreeRoot for Arc<SyntaxRoot> {} |
12 | 12 | ||
@@ -83,14 +83,12 @@ impl<R: TreeRoot> SyntaxNode<R> { | |||
83 | self.red().green().text() | 83 | self.red().green().text() |
84 | } | 84 | } |
85 | 85 | ||
86 | pub fn children<'a>(&'a self) -> impl Iterator<Item=SyntaxNode<R>> + 'a { | 86 | pub fn children<'a>(&'a self) -> impl Iterator<Item = SyntaxNode<R>> + 'a { |
87 | let red = self.red(); | 87 | let red = self.red(); |
88 | let n_children = red.n_children(); | 88 | let n_children = red.n_children(); |
89 | (0..n_children).map(move |i| { | 89 | (0..n_children).map(move |i| SyntaxNode { |
90 | SyntaxNode { | 90 | root: self.root.clone(), |
91 | root: self.root.clone(), | 91 | red: red.get_child(i).unwrap(), |
92 | red: red.get_child(i).unwrap(), | ||
93 | } | ||
94 | }) | 92 | }) |
95 | } | 93 | } |
96 | 94 | ||