Skip to content

Commit

Permalink
refactor (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 19, 2022
1 parent 3925298 commit 6ac7dbe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions git-repository/src/object/tree.rs
Expand Up @@ -37,7 +37,6 @@ impl<'repo> Tree<'repo> {
I: IntoIterator<Item = P>,
P: PartialEq<BStr>,
{
// let mut out = None;
let mut path = path.into_iter().peekable();
while let Some(component) = path.next() {
match TreeRefIter::from_bytes(&self.data)
Expand All @@ -49,9 +48,9 @@ impl<'repo> Tree<'repo> {
return Ok(Some(entry.into()));
} else {
let next_id = entry.oid.to_owned();
let handle = self.repo;
let repo = self.repo;
drop(self);
self = match handle.find_object(next_id)?.try_into_tree() {
self = match repo.find_object(next_id)?.try_into_tree() {
Ok(tree) => tree,
Err(_) => return Ok(None),
};
Expand Down

0 comments on commit 6ac7dbe

Please sign in to comment.