From 896a9b69130196f056f1797f5c1beb8f6c269cba Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 22 Sep 2022 18:08:41 +0200 Subject: [PATCH] Derive Eq for Path, CanonicalPath (#63) * Derive Eq for Path Signed-off-by: Matthias Beyer * Derive Eq for CanonicalPath Signed-off-by: Matthias Beyer Signed-off-by: Matthias Beyer --- src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b9026ff..ce706b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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, } @@ -277,8 +277,6 @@ impl AsRef for Path { } } -impl Eq for Path {} - impl PartialEq for Path { fn eq(&self, other: &path::PathBuf) -> bool { self.inner == *other @@ -304,7 +302,7 @@ impl PartialEq 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, } @@ -411,8 +409,6 @@ impl AsRef for CanonicalPath { } } -impl Eq for CanonicalPath {} - impl PartialEq for CanonicalPath { fn eq(&self, other: &path::PathBuf) -> bool { self.inner == *other