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
2222{
2323 #[ inline]
2424 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 ,
2928 }
3029 }
3130 #[ inline]
3231 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 ,
3735 }
3836 }
3937}
@@ -45,18 +43,16 @@ where
4543{
4644 #[ inline]
4745 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 ,
5249 }
5350 }
5451 #[ inline]
5552 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 ,
6056 }
6157 }
6258}
You can’t perform that action at this time.
0 commit comments