Skip to content

Commit

Permalink
Derive Eq for Path, CanonicalPath (#63)
Browse files Browse the repository at this point in the history
* Derive Eq for Path

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

* Derive Eq for CanonicalPath

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
  • Loading branch information
matthiasbeyer authored Sep 22, 2022
1 parent 492df70 commit 896a9b6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ fn build_binary_checker() -> CompositeChecker {
///
/// Since `which::Path` implements `Deref` for `std::path::Path`, all methods on `&std::path::Path`
/// are also available to `&which::Path` values.
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
pub struct Path {
inner: path::PathBuf,
}
Expand Down Expand Up @@ -277,8 +277,6 @@ impl AsRef<OsStr> for Path {
}
}

impl Eq for Path {}

impl PartialEq<path::PathBuf> for Path {
fn eq(&self, other: &path::PathBuf) -> bool {
self.inner == *other
Expand All @@ -304,7 +302,7 @@ impl PartialEq<Path> for path::PathBuf {
///
/// Since `CanonicalPath` implements `Deref` for `std::path::Path`, all methods on
/// `&std::path::Path` are also available to `&CanonicalPath` values.
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
pub struct CanonicalPath {
inner: path::PathBuf,
}
Expand Down Expand Up @@ -411,8 +409,6 @@ impl AsRef<OsStr> for CanonicalPath {
}
}

impl Eq for CanonicalPath {}

impl PartialEq<path::PathBuf> for CanonicalPath {
fn eq(&self, other: &path::PathBuf) -> bool {
self.inner == *other
Expand Down

0 comments on commit 896a9b6

Please sign in to comment.