diff --git a/exercises/move_semantics/move_semantics6.rs b/exercises/move_semantics/move_semantics6.rs index 2dfe3b4b..9b1711a3 100644 --- a/exercises/move_semantics/move_semantics6.rs +++ b/exercises/move_semantics/move_semantics6.rs @@ -2,7 +2,7 @@ // Execute `rustlings hint move_semantics6` or use the `hint` watch subcommand for a hint. // You can't change anything except adding or removing references. -// I AM NOT DONE + fn main() { let data = "Rust is great!".to_string(); diff --git a/exercises/vecs/vecs2.rs b/exercises/vecs/vecs2.rs index 073759e2..80f28b7b 100644 --- a/exercises/vecs/vecs2.rs +++ b/exercises/vecs/vecs2.rs @@ -12,7 +12,7 @@ fn vec_loop(mut v: Vec) -> Vec { for element in v.iter_mut() { // TODO: Fill this up so that each element in the Vec `v` is // multiplied by 2. - *i = *i * 2; + *element = *element * 2; } // At this point, `v` should be equal to [4, 8, 12, 16, 20]. @@ -23,7 +23,7 @@ fn vec_map(v: &Vec) -> Vec { v.iter().map(|element| { // TODO: Do the same thing as above - but instead of mutating the // Vec, you can just return the new number! - num * 2 + element * 2 }).collect() }