mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 06:57:31 -05:00
Update iterator sol in quiz2.rs
This commit is contained in:
parent
9d7b973a62
commit
5372caefb3
1 changed files with 1 additions and 6 deletions
|
@ -52,12 +52,7 @@ mod my_module {
|
||||||
.map(|(mut string, command)| match command {
|
.map(|(mut string, command)| match command {
|
||||||
Command::Uppercase => string.to_uppercase(),
|
Command::Uppercase => string.to_uppercase(),
|
||||||
Command::Trim => string.trim().to_string(),
|
Command::Trim => string.trim().to_string(),
|
||||||
Command::Append(n) => {
|
Command::Append(n) => string + &"bar".repeat(n),
|
||||||
for _ in 0..n {
|
|
||||||
string += "bar";
|
|
||||||
}
|
|
||||||
string
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue