Skip to content

Commit

Permalink
Formatting and explicitely state slice comparisons.
Browse files Browse the repository at this point in the history
  • Loading branch information
novacrazy committed Sep 1, 2017
1 parent bea11ca commit cbee34d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/impls.rs
Expand Up @@ -22,6 +22,7 @@ where
self.map_ref(|x| x.clone())
}
}

impl<T: Copy, N> Copy for GenericArray<T, N>
where
N: ArrayLength<T>,
Expand All @@ -37,6 +38,7 @@ where
**self == **other
}
}

impl<T: Eq, N> Eq for GenericArray<T, N>
where
N: ArrayLength<T>,
Expand All @@ -48,7 +50,7 @@ where
N: ArrayLength<T>,
{
fn partial_cmp(&self, other: &GenericArray<T, N>) -> Option<Ordering> {
PartialOrd::partial_cmp(&self, &other)
PartialOrd::partial_cmp(self.as_slice(), other.as_slice())
}
}

Expand All @@ -57,7 +59,7 @@ where
N: ArrayLength<T>,
{
fn cmp(&self, other: &GenericArray<T, N>) -> Ordering {
Ord::cmp(&self, &other)
Ord::cmp(self.as_slice(), other.as_slice())
}
}

Expand Down

0 comments on commit cbee34d

Please sign in to comment.