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<Type>, To: [const] AsRef<[Type]>, const N: usize> PartialEq<To> for Array<Type, N> {
24 #[inline]
25 fn eq(&self, other: &To) -> bool {return self.as_ref().eq(other.as_ref())}
26}
27
28const impl<Type: [const] PartialOrd<Type>, To: [const] AsRef<[Type]>, const N: usize> PartialOrd<To> for Array<Type, N> {
30 #[inline]
31 fn partial_cmp(&self, other: &To) -> Option<Ordering> {return 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) {return 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 {return self.as_ref().cmp(other.as_ref())}
47}