File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -45,15 +45,6 @@ macro_rules! impl_array_newtype {
4545 }
4646 }
4747
48- impl AsRef <[ $ty; $len] > for $thing {
49- #[ inline]
50- /// Gets a reference to the underlying array
51- fn as_ref( & self ) -> & [ $ty; $len] {
52- let & $thing( ref dat) = self ;
53- dat
54- }
55- }
56-
5748 // We cannot derive these traits because Rust 1.41.1 requires `std::array::LengthAtMost32`.
5849
5950 #[ cfg( fuzzing) ]
@@ -90,6 +81,15 @@ macro_rules! impl_array_newtype {
9081 }
9182 }
9283
84+ impl AsRef <[ $ty; $len] > for $thing {
85+ #[ inline]
86+ /// Gets a reference to the underlying array
87+ fn as_ref( & self ) -> & [ $ty; $len] {
88+ let & $thing( ref dat) = self ;
89+ dat
90+ }
91+ }
92+
9393 impl <I > core:: ops:: Index <I > for $thing
9494 where
9595 [ $ty] : core:: ops:: Index <I >,
Original file line number Diff line number Diff line change 1818macro_rules! impl_array_newtype {
1919 ( $thing: ident, $ty: ty, $len: expr) => {
2020
21- impl AsRef <[ $ty; $len] > for $thing {
22- #[ inline]
23- /// Gets a reference to the underlying array
24- fn as_ref( & self ) -> & [ $ty; $len] {
25- let & $thing( ref dat) = self ;
26- dat
27- }
28- }
29-
3021 // We cannot derive these traits because Rust 1.41.1 requires `std::array::LengthAtMost32`.
3122
3223 impl PartialEq for $thing {
@@ -58,6 +49,15 @@ macro_rules! impl_array_newtype {
5849 }
5950 }
6051
52+ impl AsRef <[ $ty; $len] > for $thing {
53+ #[ inline]
54+ /// Gets a reference to the underlying array
55+ fn as_ref( & self ) -> & [ $ty; $len] {
56+ let & $thing( ref dat) = self ;
57+ dat
58+ }
59+ }
60+
6161 impl <I > core:: ops:: Index <I > for $thing
6262 where
6363 [ $ty] : core:: ops:: Index <I >,
You can’t perform that action at this time.
0 commit comments