Skip to content

Commit 5372cae

Browse files
Update iterator sol in quiz2.rs
1 parent 9d7b973 commit 5372cae

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

solutions/quizzes/quiz2.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,7 @@ mod my_module {
5252
.map(|(mut string, command)| match command {
5353
Command::Uppercase => string.to_uppercase(),
5454
Command::Trim => string.trim().to_string(),
55-
Command::Append(n) => {
56-
for _ in 0..n {
57-
string += "bar";
58-
}
59-
string
60-
}
55+
Command::Append(n) => string + &"bar".repeat(n),
6156
})
6257
.collect()
6358
}

0 commit comments

Comments
 (0)