diff options
| author | liv <mokou@fastmail.com> | 2023-03-14 11:15:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 11:15:07 +0100 |
| commit | a55c8dc1a8bc787f537e91c0979eefc639dacfb7 (patch) | |
| tree | a25350eb0ff742f28ac1aec13676e8f803d1c02c | |
| parent | 5c5cd4c658ebb82f26f88b07660c1fc0fcb6ac14 (diff) | |
| parent | 7bab78c66d4c0fff4b9f7ca082964353215265e3 (diff) | |
Merge pull request #1418 from adamhb123/vecs2.rs-naming-suggestion
Rename iteration var names in vec2.rs for clarity
| -rw-r--r-- | exercises/vecs/vecs2.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exercises/vecs/vecs2.rs b/exercises/vecs/vecs2.rs index 5bea09a..1ea2607 100644 --- a/exercises/vecs/vecs2.rs +++ b/exercises/vecs/vecs2.rs @@ -9,7 +9,7 @@ // I AM NOT DONE fn vec_loop(mut v: Vec<i32>) -> Vec<i32> { - for i in v.iter_mut() { + for element in v.iter_mut() { // TODO: Fill this up so that each element in the Vec `v` is // multiplied by 2. ??? @@ -20,7 +20,7 @@ fn vec_loop(mut v: Vec<i32>) -> Vec<i32> { } fn vec_map(v: &Vec<i32>) -> Vec<i32> { - v.iter().map(|num| { + v.iter().map(|element| { // TODO: Do the same thing as above - but instead of mutating the // Vec, you can just return the new number! ??? |
