Arrays & Slices
Array
let m = [1, 2, 3]; // Rust will infer the type and length let n: [i32; 3] = [1, 2, 3];
Slice
let x = [1, 2, 3]; let slice = &x[1..]; // A slice starting from index 1
Reference
Last updated
let m = [1, 2, 3]; // Rust will infer the type and length
let n: [i32; 3] = [1, 2, 3];let x = [1, 2, 3];
let slice = &x[1..]; // A slice starting from index 1Last updated