Skip to content

Commit

Permalink
hybrid-array: reorder impls (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored Dec 31, 2023
1 parent e8ed114 commit 32a4aa5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hybrid-array/src/sizes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ use super::{Array, ArrayOps, ArraySize, AssociatedArraySize};
macro_rules! impl_array_size {
($($len:expr => $ty:ident),+) => {
$(
unsafe impl ArraySize for typenum::$ty {
type ArrayType<T> = [T; $len];
}

impl<T> AssociatedArraySize for [T; $len] {
type Size = typenum::$ty;
}

impl<T> ArrayOps<T, $len> for Array<T, typenum::$ty> {
const SIZE: usize = $len;

Expand Down Expand Up @@ -43,14 +51,6 @@ macro_rules! impl_array_size {
self.0.map(f)
}
}

unsafe impl ArraySize for typenum::$ty {
type ArrayType<T> = [T; $len];
}

impl<T> AssociatedArraySize for [T; $len] {
type Size = typenum::$ty;
}
)+
};
}
Expand Down

0 comments on commit 32a4aa5

Please sign in to comment.