2018-02-22 06:09:53 +00:00
|
|
|
// primitive_types4.rs
|
2023-05-29 17:39:08 +00:00
|
|
|
//
|
2019-11-12 11:50:33 +00:00
|
|
|
// Get a slice out of Array a where the ??? is so that the test passes.
|
2023-05-29 17:39:08 +00:00
|
|
|
//
|
|
|
|
// Execute `rustlings hint primitive_types4` or use the `hint` watch subcommand
|
|
|
|
// for a hint.
|
2016-02-07 17:24:38 +00:00
|
|
|
|
2019-11-11 12:38:24 +00:00
|
|
|
// I AM NOT DONE
|
|
|
|
|
2019-08-18 00:14:00 +00:00
|
|
|
#[test]
|
2019-11-12 11:50:33 +00:00
|
|
|
fn slice_out_of_array() {
|
2016-02-07 17:24:38 +00:00
|
|
|
let a = [1, 2, 3, 4, 5];
|
|
|
|
|
2020-04-08 08:42:35 +00:00
|
|
|
let nice_slice = ???
|
|
|
|
|
|
|
|
assert_eq!([2, 3, 4], nice_slice)
|
2016-02-07 17:24:38 +00:00
|
|
|
}
|