primitive_types4.rs (341B)
1 fn main() { 2 // You can optionally experiment here. 3 } 4 5 #[cfg(test)] 6 mod tests { 7 #[test] 8 fn slice_out_of_array() { 9 let a = [1, 2, 3, 4, 5]; 10 11 // TODO: Get a slice called `nice_slice` out of the array `a` so that the test passes. 12 let nice_slice = &a[1..4]; 13 14 assert_eq!([2, 3, 4], nice_slice); 15 } 16 }