diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-18 16:34:17 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-18 16:34:17 -0500 |
| commit | 177787395f4179e8510adfba52e211b151774372 (patch) | |
| tree | 2c7229af2b1214c649c8d02ee4eb94f7e58f2c12 /rustlings/exercises/05_vecs/vecs2.rs | |
| parent | 8f0234e3a297d99c958e8b85e131ec9323cd53c7 (diff) | |
rustlings: complete 05
Diffstat (limited to 'rustlings/exercises/05_vecs/vecs2.rs')
| -rw-r--r-- | rustlings/exercises/05_vecs/vecs2.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rustlings/exercises/05_vecs/vecs2.rs b/rustlings/exercises/05_vecs/vecs2.rs index a9be258..1ec77f7 100644 --- a/rustlings/exercises/05_vecs/vecs2.rs +++ b/rustlings/exercises/05_vecs/vecs2.rs @@ -4,6 +4,7 @@ fn vec_loop(input: &[i32]) -> Vec<i32> { for element in input { // TODO: Multiply each element in the `input` slice by 2 and push it to // the `output` vector. + output.push(element * 2); } output @@ -24,7 +25,7 @@ fn vec_map(input: &[i32]) -> Vec<i32> { input .iter() .map(|element| { - // ??? + element * 2 }) .collect() } |