Macro array_zeros

Source
macro_rules! array_zeros {
    (Tuple2<$t1:ty, $t2:ty>, $($tt:tt)*) => { ... };
    (Tuple3<$t1:ty, $t2:ty, $t3:ty>, $($tt:tt)*) => { ... };
    (List<$t1:ty>, $($tt:tt)*) => { ... };
    (char, $($tt:tt)*) => { ... };
    (String, $($tt:tt)*) => { ... };
    ($([$($nested:expr),*]),* $(,)*) => { ... };
    ($tt:ty, $([$($nested:expr),*]),* $(,)*) => { ... };
    ($tt:ty, $($x:expr),* $(,)*) => { ... };
}
Expand description

Create an array of zeros

ยงExamples

use arr_rs::prelude::*;

let arr = array_zeros!(i32, 8);
assert_eq!(array!(i32, [0, 0, 0, 0, 0, 0, 0, 0]), arr);
let arr = array_zeros!(i32, 2, 2, 2);
assert_eq!(array!(i32, [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]), arr);