From 1b5b56b55b009491186d65fff5686f80228716c2 Mon Sep 17 00:00:00 2001 From: akshitgautam42 Date: Sun, 12 Nov 2023 15:05:32 +0530 Subject: [PATCH] Exercise 28 --- exercises/06_move_semantics/move_semantics3.rs | 2 +- exercises/06_move_semantics/move_semantics4.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/06_move_semantics/move_semantics3.rs b/exercises/06_move_semantics/move_semantics3.rs index c47a17c6..8d50352f 100644 --- a/exercises/06_move_semantics/move_semantics3.rs +++ b/exercises/06_move_semantics/move_semantics3.rs @@ -6,7 +6,7 @@ // Execute `rustlings hint move_semantics3` or use the `hint` watch subcommand // for a hint. -// I AM NOT DONE + #[test] fn main() { diff --git a/exercises/06_move_semantics/move_semantics4.rs b/exercises/06_move_semantics/move_semantics4.rs index 80b49dba..c8df5ce7 100644 --- a/exercises/06_move_semantics/move_semantics4.rs +++ b/exercises/06_move_semantics/move_semantics4.rs @@ -7,19 +7,19 @@ // Execute `rustlings hint move_semantics4` 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 mut vec1 = fill_vec(vec0.clone()); assert_eq!(vec1, vec![22, 44, 66, 88]); } // `fill_vec()` no longer takes `vec: Vec` as argument - don't change this! -fn fill_vec() -> Vec { +fn fill_vec(vec:Vec) -> Vec { // Instead, let's create and fill the Vec in here - how do you do that? let mut vec = vec;