Simplify lifetimes in Node::children in the rust bindings
This commit is contained in:
parent
a20fc3c111
commit
14a483f4c3
1 changed files with 3 additions and 2 deletions
|
|
@ -469,10 +469,11 @@ impl<'tree> Node<'tree> {
|
|||
unsafe { ffi::ts_node_child_count(self.0) as usize }
|
||||
}
|
||||
|
||||
pub fn children<'a>(&'a self) -> impl Iterator<Item = Node<'tree>> + 'a {
|
||||
pub fn children(&self) -> impl Iterator<Item = Node<'tree>> {
|
||||
let me = self.clone();
|
||||
(0..self.child_count())
|
||||
.into_iter()
|
||||
.map(move |i| self.child(i).unwrap())
|
||||
.map(move |i| me.child(i).unwrap())
|
||||
}
|
||||
|
||||
pub fn named_child<'a>(&'a self, i: usize) -> Option<Self> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue