diff options
| author | NitinKM <70827815+NewtonChutney@users.noreply.github.com> | 2024-07-07 23:19:38 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-07 23:19:38 +0530 |
| commit | 5372caefb350dfde4e5ce018cf9dc59742558004 (patch) | |
| tree | 6fda839cb36a3885cbead26145a29eceb5bbf366 | |
| parent | 9d7b973a62d3c0181be386752d72fa0722fe6135 (diff) | |
Update iterator sol in quiz2.rs
| -rw-r--r-- | solutions/quizzes/quiz2.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/solutions/quizzes/quiz2.rs b/solutions/quizzes/quiz2.rs index 2f5cc05..be3f159 100644 --- a/solutions/quizzes/quiz2.rs +++ b/solutions/quizzes/quiz2.rs @@ -52,12 +52,7 @@ mod my_module { .map(|(mut string, command)| match command { Command::Uppercase => string.to_uppercase(), Command::Trim => string.trim().to_string(), - Command::Append(n) => { - for _ in 0..n { - string += "bar"; - } - string - } + Command::Append(n) => string + &"bar".repeat(n), }) .collect() } |
