summaryrefslogtreecommitdiff
path: root/solutions
diff options
context:
space:
mode:
authorMo <76752051+mo8it@users.noreply.github.com>2024-07-07 20:25:21 +0200
committerGitHub <noreply@github.com>2024-07-07 20:25:21 +0200
commit6469e9734b47d2a34ad3aeaa4e7c68c7ca679f00 (patch)
tree6fda839cb36a3885cbead26145a29eceb5bbf366 /solutions
parent9d7b973a62d3c0181be386752d72fa0722fe6135 (diff)
parent5372caefb350dfde4e5ce018cf9dc59742558004 (diff)
Merge pull request #2031 from NewtonChutney/patch-1
Update iterator solution in quiz2.rs
Diffstat (limited to 'solutions')
-rw-r--r--solutions/quizzes/quiz2.rs7
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()
}