macro_rules! array {
() => { ... };
(=> $cap:literal) => { ... };
($elem:expr; $n:expr) => { ... };
($elem:expr; $n:expr => $cap:literal) => { ... };
($($x:expr),+ $(,)?) => { ... };
($($x:expr),+ $(,)? => $cap:literal) => { ... };
}Expand description
create an Array.
like vec!, array! has similar syntax as Rust array expressions, with
the addition of allowing one to specify the capacity of the Array
by appending an =>:
let array = array![1, 2, 3 => 6]; // capacity of 6 elements
assert_eq!(array[0], 1);
assert_eq!(array[1], 2);
assert_eq!(array[2], 3);