From 80fd5823b00f663704f2f585336d34b3e38a9490 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Fri, 12 Oct 2018 23:25:31 +0200 Subject: [PATCH] Explicitly implement PartialEq for ObjectName to satisfy clippy --- rust-bindings/rust/libostree/src/object_name.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rust-bindings/rust/libostree/src/object_name.rs b/rust-bindings/rust/libostree/src/object_name.rs index 463a0606..e6494923 100644 --- a/rust-bindings/rust/libostree/src/object_name.rs +++ b/rust-bindings/rust/libostree/src/object_name.rs @@ -14,7 +14,7 @@ fn hash_object_name(v: &glib::Variant) -> u32 { unsafe { ffi::ostree_hash_object_name(v.to_glib_none().0 as glib_ffi::gconstpointer) } } -#[derive(PartialEq, Eq, Debug)] +#[derive(Eq, Debug)] pub struct ObjectName { variant: glib::Variant, checksum: String, @@ -66,3 +66,9 @@ impl Hash for ObjectName { state.write_u32(hash_object_name(&self.variant)); } } + +impl PartialEq for ObjectName { + fn eq(&self, other: &ObjectName) -> bool { + self.checksum == other.checksum && self.object_type == other.object_type + } +}