File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ serde = ["dep:serde_core"]
2828compat-0_14 = [" dep:generic_array-0_14" ]
2929
3030[dependencies ]
31- typenum = { version = " 1.17 " , features = [" const-generics" ] }
31+ typenum = { version = " 1.19 " , features = [" const-generics" ] }
3232const-default = { version = " 1" , optional = true , default-features = false }
3333serde_core = { version = " 1.0" , optional = true , default-features = false }
3434zeroize = { version = " 1" , optional = true , default-features = false }
Original file line number Diff line number Diff line change @@ -283,8 +283,19 @@ where
283283/// Associated [`ArrayLength`] for one [`Const<N>`]
284284///
285285/// See [`IntoArrayLength`] for more information.
286+ ///
287+ /// Note that not all `N` values are valid due to limitations inherent to `typenum` and Rust. You
288+ /// may need to combine [Const] with other typenum operations to get the desired length.
286289pub type ConstArrayLength < const N : usize > = <Const < N > as IntoArrayLength >:: ArrayLength ;
287290
291+ /// [`GenericArray`] with a const-generic `usize` length, using the [`ConstArrayLength`] type alias for `N`.
292+ ///
293+ /// To construct from a literal array, use [`from_array`](GenericArray::from_array).
294+ ///
295+ /// Note that not all `N` values are valid due to limitations inherent to `typenum` and Rust. You
296+ /// may need to combine [Const] with other typenum operations to get the desired length.
297+ pub type ConstGenericArray < T , const N : usize > = GenericArray < T , ConstArrayLength < N > > ;
298+
288299/// Internal type used to generate a struct of appropriate size
289300#[ allow( dead_code) ]
290301#[ repr( C ) ]
You can’t perform that action at this time.
0 commit comments