Merge pull request #19 from akshitgautam42/Ex-20

Exercise 20
This commit is contained in:
Akshit Gautam 2023-11-12 12:14:37 +05:30 committed by GitHub
commit 15d032a371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,13 +5,13 @@
// Execute `rustlings hint primitive_types4` or use the `hint` watch subcommand
// for a hint.
// I AM NOT DONE
#[test]
fn slice_out_of_array() {
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)
}