mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 15:26:29 +00:00
Merge pull request #2031 from NewtonChutney/patch-1
Update iterator solution in quiz2.rs
This commit is contained in:
commit
6469e9734b
1 changed files with 1 additions and 6 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue