File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,16 @@ where
22
22
{
23
23
#[ inline]
24
24
fn eq ( & self , other : & [ U ] ) -> bool {
25
- let b: Result < & [ U ; N ] , _ > = other. try_into ( ) ;
26
- match b {
27
- Ok ( b) => * self == * b,
28
- Err ( _) => false ,
25
+ match other. as_array :: < N > ( ) {
26
+ Some ( b) => * self == * b,
27
+ None => false ,
29
28
}
30
29
}
31
30
#[ inline]
32
31
fn ne ( & self , other : & [ U ] ) -> bool {
33
- let b: Result < & [ U ; N ] , _ > = other. try_into ( ) ;
34
- match b {
35
- Ok ( b) => * self != * b,
36
- Err ( _) => true ,
32
+ match other. as_array :: < N > ( ) {
33
+ Some ( b) => * self != * b,
34
+ None => true ,
37
35
}
38
36
}
39
37
}
@@ -45,18 +43,16 @@ where
45
43
{
46
44
#[ inline]
47
45
fn eq ( & self , other : & [ U ; N ] ) -> bool {
48
- let b: Result < & [ T ; N ] , _ > = self . try_into ( ) ;
49
- match b {
50
- Ok ( b) => * b == * other,
51
- Err ( _) => false ,
46
+ match self . as_array :: < N > ( ) {
47
+ Some ( b) => * b == * other,
48
+ None => false ,
52
49
}
53
50
}
54
51
#[ inline]
55
52
fn ne ( & self , other : & [ U ; N ] ) -> bool {
56
- let b: Result < & [ T ; N ] , _ > = self . try_into ( ) ;
57
- match b {
58
- Ok ( b) => * b != * other,
59
- Err ( _) => true ,
53
+ match self . as_array :: < N > ( ) {
54
+ Some ( b) => * b != * other,
55
+ None => true ,
60
56
}
61
57
}
62
58
}
You can’t perform that action at this time.
0 commit comments