From d47d23ee8681b80e182083eaf31674dac092df0b Mon Sep 17 00:00:00 2001 From: Hariettemaina Date: Thu, 25 May 2023 11:03:29 +0300 Subject: [PATCH] fixed the variable name to make vecs multiplied by 2 --- exercises/quiz2.rs | 2 +- exercises/vecs/vecs2.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/quiz2.rs b/exercises/quiz2.rs index 23488ad4..52ff122d 100644 --- a/exercises/quiz2.rs +++ b/exercises/quiz2.rs @@ -18,7 +18,7 @@ // - The output element is going to be a Vector of strings. // Execute `rustlings hint quiz2` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE + pub enum Command { Uppercase, diff --git a/exercises/vecs/vecs2.rs b/exercises/vecs/vecs2.rs index 971a9f57..41c3f338 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 *= 2; + *element *= 2; } // At this point, `v` should be equal to [4, 8, 12, 16, 20]. @@ -20,7 +20,7 @@ fn vec_loop(mut v: Vec) -> Vec { } fn vec_map(v: &Vec) -> Vec { - v.iter().map(|element| { + v.iter().map(|&num| { // TODO: Do the same thing as above - but instead of mutating the // Vec, you can just return the new number! num * 2