Macro array

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

Create an array

ยงExamples

use arr_rs::prelude::*;

let arr = array!(i16, 1, 2, 3, 4, 5, 6, 7, 8).unwrap();
let arr = array!(i16, [1, 2, 3, 4, 5, 6, 7, 8]).unwrap();
let arr = array!(i32, [[1, 2], [3, 4], [5, 6], [7, 8]]).unwrap();
let arr = array!(f64, [[1, 2, 3, 4], [5, 6, 7, 8]]).unwrap();