aboutsummaryrefslogtreecommitdiff
path: root/src/yellow/syntax.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-31 13:40:40 +0100
committerAleksey Kladov <[email protected]>2018-07-31 13:40:40 +0100
commit9ce7e8110254e8db476c96bce2eecb2d16983159 (patch)
treeabaddbafc4593948849394b430e3bde5c624fa22 /src/yellow/syntax.rs
parent2a2815266b35de12bd3c48cc405e8b3e8fcf8885 (diff)
cleanups
Diffstat (limited to 'src/yellow/syntax.rs')
-rw-r--r--src/yellow/syntax.rs12
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
9pub trait TreeRoot: Deref<Target=SyntaxRoot> + Clone {} 9pub trait TreeRoot: Deref<Target = SyntaxRoot> + Clone {}
10 10
11impl TreeRoot for Arc<SyntaxRoot> {} 11impl 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