Skip to content

Commit

Permalink
Merge pull request rust-lang#116 from Parakleta/patch-1
Browse files Browse the repository at this point in the history
Add IntoIterator trait around Tree::iter() method
  • Loading branch information
alexcrichton committed Mar 4, 2016
2 parents f54ef2e + 8ebf249 commit 3f60e30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ impl<'repo> Drop for Tree<'repo> {
}
}

impl<'repo, 'iter> IntoIterator for &'iter Tree<'repo> {
type Item = TreeEntry<'iter>;
type IntoIter = TreeIter<'iter>;
fn into_iter(self) -> Self::IntoIter {
self.iter()
}
}

/// Create a new tree entry from the raw pointer provided.
///
/// The lifetime of the entry is tied to the tree provided and the function
Expand Down

0 comments on commit 3f60e30

Please sign in to comment.