diff --git a/hybrid-array/src/lib.rs b/hybrid-array/src/lib.rs index 750389f0..e8f2fd69 100644 --- a/hybrid-array/src/lib.rs +++ b/hybrid-array/src/lib.rs @@ -44,6 +44,9 @@ use typenum::{Diff, Sum, Unsigned}; #[cfg(feature = "zeroize")] use zeroize::{Zeroize, ZeroizeOnDrop}; +/// Type alias for [`Array`] which is const generic around a size `N`, ala `[T; N]`. +pub type ArrayN = Array::Size>; + /// Hybrid typenum-based and const generic array type. /// /// Provides the flexibility of typenum-based expressions while also diff --git a/hybrid-array/tests/mod.rs b/hybrid-array/tests/mod.rs index 1ad9adb6..c4b86196 100644 --- a/hybrid-array/tests/mod.rs +++ b/hybrid-array/tests/mod.rs @@ -1,8 +1,11 @@ -use hybrid_array::Array; +use hybrid_array::{Array, ArrayN}; use typenum::{U0, U2, U3, U4, U6, U7}; const EXAMPLE_SLICE: &[u8] = &[1, 2, 3, 4, 5, 6]; +/// Ensure `ArrayN` works as expected. +const _FOO: ArrayN = Array([1, 2, 3, 4]); + #[test] fn clone_from_slice() { let array = Array::::clone_from_slice(EXAMPLE_SLICE);