diff options
Diffstat (limited to 'solutions/quizzes')
| -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() } |
