Skip to content

Commit 2dace63

Browse files
committed
getrandom_array: Demonstrate more layers of nested arrays.
1 parent 2b164cd commit 2dace63

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ unsafe impl<T: TransmuteFromArbitraryBytes, const N: usize> TransmuteFromArbitra
394394
/// # }
395395
/// ```
396396
///
397+
/// The number of nested arrays is limited only by whatever limits the compiler
398+
/// imposes:
399+
/// ```
400+
/// # use getrandom::getrandom_array;
401+
/// let lots_of_layers_of_nesting =
402+
/// getrandom_array::<[[[[[[[[[[[[[[[[u8; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]; 1]>();
403+
/// ```
404+
///
397405
/// The patterns above allows us to avoid implementing
398406
/// `TransmuteFromArbitraryBytes` for an endless number of types.
399407
#[cfg(feature = "rust-1-55")]

0 commit comments

Comments
 (0)