Exercise 20

This commit is contained in:
akshitgautam42 2023-11-12 11:57:08 +05:30
parent 4456897abf
commit b0f3cead0f

View File

@ -5,13 +5,13 @@
// Execute `rustlings hint primitive_types4` or use the `hint` watch subcommand // Execute `rustlings hint primitive_types4` or use the `hint` watch subcommand
// for a hint. // for a hint.
// I AM NOT DONE
#[test] #[test]
fn slice_out_of_array() { fn slice_out_of_array() {
let a = [1, 2, 3, 4, 5]; let a = [1, 2, 3, 4, 5];
let nice_slice = ??? let nice_slice = &a[1..4];//index into array slice
assert_eq!([2, 3, 4], nice_slice) assert_eq!([2, 3, 4], nice_slice)
} }