diff --git a/fixed_wide_vectors/src/macros/matrix.rs b/fixed_wide_vectors/src/macros/matrix.rs index 05a213f..1964dff 100644 --- a/fixed_wide_vectors/src/macros/matrix.rs +++ b/fixed_wide_vectors/src/macros/matrix.rs @@ -32,20 +32,6 @@ macro_rules! impl_matrix { } } - impl PartialEq for Matrix{ - fn eq(&self,other:&Self)->bool{ - self.array==other.array - } - } - - impl Eq for Matrix{} - - impl core::hash::Hash for Matrix{ - fn hash(&self,state:&mut H){ - self.array.hash(state); - } - } - impl Default for Matrix{ fn default()->Self{ Self{ diff --git a/fixed_wide_vectors/src/macros/vector.rs b/fixed_wide_vectors/src/macros/vector.rs index 24fe199..2ea5dfb 100644 --- a/fixed_wide_vectors/src/macros/vector.rs +++ b/fixed_wide_vectors/src/macros/vector.rs @@ -40,20 +40,6 @@ macro_rules! impl_vector { } } - impl PartialEq for Vector{ - fn eq(&self,other:&Self)->bool{ - self.array==other.array - } - } - - impl Eq for Vector{} - - impl core::hash::Hash for Vector{ - fn hash(&self,state:&mut H){ - self.array.hash(state); - } - } - impl Default for Vector{ fn default()->Self{ Self{ diff --git a/fixed_wide_vectors/src/matrix.rs b/fixed_wide_vectors/src/matrix.rs index a4ec526..4ca1236 100644 --- a/fixed_wide_vectors/src/matrix.rs +++ b/fixed_wide_vectors/src/matrix.rs @@ -1,4 +1,4 @@ -#[derive(Clone,Copy)] +#[derive(Clone,Copy,Hash,Eq,PartialEq)] pub struct Matrix{ pub(crate) array:[[T;Y];X], } diff --git a/fixed_wide_vectors/src/vector.rs b/fixed_wide_vectors/src/vector.rs index b706670..ffea1f0 100644 --- a/fixed_wide_vectors/src/vector.rs +++ b/fixed_wide_vectors/src/vector.rs @@ -1,4 +1,4 @@ -#[derive(Clone,Copy)] +#[derive(Clone,Copy,Hash,Eq,PartialEq)] pub struct Vector{ pub(crate) array:[T;N], }