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