diff --git a/exercises/06_move_semantics/move_semantics3.rs b/exercises/06_move_semantics/move_semantics3.rs index 7af9e694..224bd7aa 100644 --- a/exercises/06_move_semantics/move_semantics3.rs +++ b/exercises/06_move_semantics/move_semantics3.rs @@ -6,19 +6,17 @@ // Execute `rustlings hint move_semantics3` or use the `hint` watch subcommand // for a hint. -// I AM NOT DONE - #[test] fn main() { let vec0 = vec![22, 44, 66]; - let mut vec1 = fill_vec(vec0); + let vec1 = fill_vec(&mut vec0.clone()); assert_eq!(vec1, vec![22, 44, 66, 88]); } -fn fill_vec(vec: Vec) -> Vec { +fn fill_vec(vec: &mut Vec) -> Vec { vec.push(88); - vec + vec.to_vec() }