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