From f4f9ce2d89a765285c4c91aa8c730fba7aedd06d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 17:53:27 +0200 Subject: [PATCH] Replace manual implementations with `derive`s --- crates/fj-kernel/src/shape/local.rs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/crates/fj-kernel/src/shape/local.rs b/crates/fj-kernel/src/shape/local.rs index ed13b9a89..e9df83444 100644 --- a/crates/fj-kernel/src/shape/local.rs +++ b/crates/fj-kernel/src/shape/local.rs @@ -1,5 +1,3 @@ -use std::hash::{Hash, Hasher}; - use super::Object; /// A reference to an object, which includes a local form @@ -14,7 +12,7 @@ use super::Object; /// terms that are useful to those objects. Two instances of `LocalForm` are /// equal, if both the local and the canonical forms are equal. The equality of /// the handle that refers to the canonical form is disregarded. -#[derive(Clone, Debug, Eq, Ord, PartialOrd)] +#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct LocalForm { local: Local, canonical: Canonical, @@ -50,24 +48,3 @@ impl LocalForm { Self::new(canonical.clone(), canonical) } } - -impl PartialEq for LocalForm -where - Local: PartialEq, - Canonical: PartialEq, -{ - fn eq(&self, other: &Self) -> bool { - self.local == other.local && self.canonical == other.canonical - } -} - -impl Hash for LocalForm -where - Local: Hash, - Canonical: Hash, -{ - fn hash(&self, state: &mut H) { - self.local.hash(state); - self.canonical.hash(state); - } -}