1//Array declaration. Array sizes must be known at compile time
2let my_array: [i32; 5] = [1, 2, 3, 4, 5];
3
4//If the size of the array is not known at compile time. Use a slice or a vector
1let _: [u8; 3] = [1, 2, 3];
2let _: [&str; 3] = ["1", "2", "3"];
3
4let _: [String; 3] = [
5 String::from("1"),
6 String::from("2"),
7 String::from("3")
8];
9
10let mut rng = rand::thread_rng();
11let _: [u8; 3] = [rng.gen(), rng.gen(), rng.gen()];