-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomparisons.rs
More file actions
47 lines (38 loc) · 928 Bytes
/
Copy pathcomparisons.rs
File metadata and controls
47 lines (38 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//^
//^ HEAD
//^
//> HEAD -> IMPORTS
use {
super::Array,
core::cmp::Ordering
};
//^
//^ EQ
//^
//> EQ -> PARTIAL CONTAINER
const impl<
Type: [const] PartialEq<Type>,
To: [const] AsRef<[Type]>,
const N: usize
> PartialEq<To> for Array<Type, N> {
fn eq(&self, other: &To) -> bool {return self.as_ref().eq(other.as_ref())}
}
//> EQ -> TOTAL
const impl<Type: [const] Eq, const N: usize> Eq for Array<Type, N> {}
//^
//^ CMP
//^
//> CMP -> PARTIAL CONTAINER
const impl<
Type: [const] PartialOrd<Type>,
To: [const] AsRef<[Type]>,
const N: usize
> PartialOrd<To> for Array<Type, N> {
fn partial_cmp(&self, other: &To) -> Option<Ordering> {
return self.as_ref().partial_cmp(other.as_ref());
}
}
//> CMP -> TOTAL
const impl<Type: [const] Ord, const N: usize> Ord for Array<Type, N> {
fn cmp(&self, other: &Self) -> Ordering {return self.as_ref().cmp(other.as_ref())}
}