From 5372caefb350dfde4e5ce018cf9dc59742558004 Mon Sep 17 00:00:00 2001 From: NitinKM <70827815+NewtonChutney@users.noreply.github.com> Date: Sun, 7 Jul 2024 23:19:38 +0530 Subject: [PATCH] Update iterator sol in quiz2.rs --- solutions/quizzes/quiz2.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/solutions/quizzes/quiz2.rs b/solutions/quizzes/quiz2.rs index 2f5cc050..be3f1597 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() }