libutils_array/
comparisons.rs1use super::Array;
7
8use core::{
10 hash::{
11 Hash,
12 Hasher
13 },
14 cmp::Ordering
15};
16
17
18const impl<Type: [const] PartialEq, const N: usize> PartialEq for Array<Type, N> {
24 #[inline]
25 fn eq(&self, other: &Self) -> bool {self.as_ref() == other.as_ref()}
26}
27
28const impl<Type: [const] PartialOrd, const N: usize> PartialOrd for Array<Type, N> {
30 #[inline]
31 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {self.as_ref().partial_cmp(other.as_ref())}
32}
33
34impl<Type: Hash, const N: usize> Hash for Array<Type, N> {
36 #[inline]
37 fn hash<Hashing: Hasher>(&self, state: &mut Hashing) {Hash::hash(self.as_ref(), state)}
38}
39
40const impl<Type: [const] Eq, const N: usize> Eq for Array<Type, N> {}
42
43const impl<Type: [const] Ord, const N: usize> Ord for Array<Type, N> {
45 #[inline]
46 fn cmp(&self, other: &Self) -> Ordering {
47 self.as_ref().cmp(other.as_ref())
48 }
49}