rust initialize array with values code example
Example: initializing array rust
let _: [u8; 3] = [1, 2, 3];
let _: [&str; 3] = ["1", "2", "3"];
let _: [String; 3] = [
String::from("1"),
String::from("2"),
String::from("3")
];
let mut rng = rand::thread_rng();
let _: [u8; 3] = [rng.gen(), rng.gen(), rng.gen()];