Skip to content

Commit

Permalink
fix clippy issues with Rust 1.74
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers committed Dec 22, 2023
1 parent 8bec623 commit bd7920e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2759,6 +2759,7 @@ impl<P: AsRef<Utf8Path>> std::iter::FromIterator<P> for Utf8PathBuf {
// ---

impl PartialEq for Utf8PathBuf {
#[inline]
fn eq(&self, other: &Utf8PathBuf) -> bool {
self.components() == other.components()
}
Expand All @@ -2767,14 +2768,16 @@ impl PartialEq for Utf8PathBuf {
impl Eq for Utf8PathBuf {}

impl Hash for Utf8PathBuf {
#[inline]
fn hash<H: Hasher>(&self, state: &mut H) {
self.as_path().hash(state)
}
}

impl PartialOrd for Utf8PathBuf {
#[inline]
fn partial_cmp(&self, other: &Utf8PathBuf) -> Option<Ordering> {
self.components().partial_cmp(other.components())
Some(self.cmp(other))
}
}

Expand All @@ -2785,6 +2788,7 @@ impl Ord for Utf8PathBuf {
}

impl PartialEq for Utf8Path {
#[inline]
fn eq(&self, other: &Utf8Path) -> bool {
self.components().eq(other.components())
}
Expand All @@ -2801,8 +2805,9 @@ impl Hash for Utf8Path {
}

impl PartialOrd for Utf8Path {
#[inline]
fn partial_cmp(&self, other: &Utf8Path) -> Option<Ordering> {
self.components().partial_cmp(other.components())
Some(self.cmp(other))
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/proptest_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ impl Arbitrary for Utf8PathBuf {
.prop_map(|(is_relative, components)| {
let initial_component =
is_relative.then(|| format!("{}", std::path::MAIN_SEPARATOR));
initial_component
.into_iter()
.chain(components.into_iter())
.collect()
initial_component.into_iter().chain(components).collect()
})
.boxed()
}
Expand Down

0 comments on commit bd7920e

Please sign in to comment.