diff --git a/Cargo.lock b/Cargo.lock index 6f4704f670..5cca965b46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2013,7 +2013,6 @@ dependencies = [ "gix-hash", "gix-hashtable", "gix-odb", - "gix-path", "gix-testtools", "gix-utils", "gix-validate", diff --git a/gix-object/Cargo.toml b/gix-object/Cargo.toml index d22bfaa985..d17574ab71 100644 --- a/gix-object/Cargo.toml +++ b/gix-object/Cargo.toml @@ -51,7 +51,6 @@ gix-hashtable = { version = "^0.12.0", path = "../gix-hashtable" } gix-validate = { version = "^0.11.0", path = "../gix-validate" } gix-actor = { version = "^0.40.0", path = "../gix-actor" } gix-date = { version = "^0.15.0", path = "../gix-date" } -gix-path = { version = "^0.11.1", path = "../gix-path" } gix-utils = { version = "^0.3.1", path = "../gix-utils" } itoa = "1.0.17" diff --git a/gix-object/src/tree/ref_iter.rs b/gix-object/src/tree/ref_iter.rs index 7e60d6ac83..8e5fc3c168 100644 --- a/gix-object/src/tree/ref_iter.rs +++ b/gix-object/src/tree/ref_iter.rs @@ -68,15 +68,13 @@ impl<'a> TreeRefIter<'a> { buffer: &'a mut Vec, relative_path: impl AsRef, ) -> Result, crate::find::Error> { - use crate::bstr::ByteSlice; self.lookup_entry( odb, buffer, - relative_path.as_ref().components().map(|c: std::path::Component<'_>| { - gix_path::os_str_into_bstr(c.as_os_str()) - .unwrap_or_else(|_| "".into()) - .as_bytes() - }), + relative_path + .as_ref() + .components() + .map(|c| c.as_os_str().as_encoded_bytes()), ) } } diff --git a/gix/src/object/tree/mod.rs b/gix/src/object/tree/mod.rs index aa8a0aa253..63e5ffb26d 100644 --- a/gix/src/object/tree/mod.rs +++ b/gix/src/object/tree/mod.rs @@ -146,12 +146,12 @@ impl<'repo> Tree<'repo> { &self, relative_path: impl AsRef, ) -> Result>, find::existing::Error> { - use crate::bstr::ByteSlice; - self.lookup_entry(relative_path.as_ref().components().map(|c: std::path::Component<'_>| { - gix_path::os_str_into_bstr(c.as_os_str()) - .unwrap_or_else(|_| "".into()) - .as_bytes() - })) + self.lookup_entry( + relative_path + .as_ref() + .components() + .map(|c| c.as_os_str().as_encoded_bytes()), + ) } /// Like [`Self::peel_to_entry()`], but takes a `Path` directly via `relative_path`, a path relative to this tree. @@ -164,12 +164,12 @@ impl<'repo> Tree<'repo> { &mut self, relative_path: impl AsRef, ) -> Result>, find::existing::Error> { - use crate::bstr::ByteSlice; - self.peel_to_entry(relative_path.as_ref().components().map(|c: std::path::Component<'_>| { - gix_path::os_str_into_bstr(c.as_os_str()) - .unwrap_or_else(|_| "".into()) - .as_bytes() - })) + self.peel_to_entry( + relative_path + .as_ref() + .components() + .map(|c| c.as_os_str().as_encoded_bytes()), + ) } }