From b0707dff05fd6e212ad7970899e32b747a6f7bfd Mon Sep 17 00:00:00 2001 From: projectmoon Date: Sun, 7 Feb 2021 21:42:32 +0000 Subject: [PATCH] bot: Move multi-failure response join() call into the format!(). --- src/bot.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bot.rs b/src/bot.rs index a08be6f..1da17a7 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -83,18 +83,17 @@ async fn handle_multiple_results( let message = if errors.len() == 0 { format!("{}: Executed {} commands", respond_to, results.len()) } else { - let failures: String = errors + let failures: Vec = errors .iter() .map(|&(cmd, err)| format!("{}: {}", cmd, err)) - .collect::>() - .join("\n"); + .collect(); format!( "{}: Executed {} commands ({} failed)\n\nFailures:\n{}", respond_to, results.len(), errors.len(), - failures + failures.join("\n") ) .replace("\n", "
") };