Skip to content

Commit

Permalink
getrandom_array: Demonstrate more layers of nested arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Oct 19, 2022
1 parent 2b164cd commit 2dace63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ unsafe impl<T: TransmuteFromArbitraryBytes, const N: usize> TransmuteFromArbitra
/// # }
/// ```
///
/// The number of nested arrays is limited only by whatever limits the compiler
/// imposes:
/// ```
/// # use getrandom::getrandom_array;
/// let lots_of_layers_of_nesting =
/// getrandom_array::<[[[[[[[[[[[[[[[[u8; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]>();
/// ```
///
/// The patterns above allows us to avoid implementing
/// `TransmuteFromArbitraryBytes` for an endless number of types.
#[cfg(feature = "rust-1-55")]
Expand Down

0 comments on commit 2dace63

Please sign in to comment.