Skip to content

Commit 77ff8ae

Browse files
committed
thanks clippy
1 parent b285097 commit 77ff8ae

File tree

1 file changed

+4
-5
lines changed
  • git-repository/src/object/tree

1 file changed

+4
-5
lines changed

git-repository/src/object/tree/mod.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ impl<'repo> Tree<'repo> {
7777
self,
7878
relative_path: impl AsRef<std::path::Path>,
7979
) -> Result<Option<git_object::tree::Entry>, find::existing::Error> {
80-
self.lookup_entry(
81-
relative_path
80+
self.lookup_entry(relative_path.as_ref().components().map(|c| {
81+
git_path::os_str_into_bstr(c.as_os_str())
82+
.unwrap_or_else(|_| "".into())
8283
.as_ref()
83-
.components()
84-
.map(|c| git_path::os_str_into_bstr(c.as_os_str()).unwrap_or("".into()).as_ref()),
85-
)
84+
}))
8685
}
8786
}
8887

0 commit comments

Comments
 (0)