bot: Move multi-failure response join() call into the format!().
continuous-integration/drone/push Build is passing Details

This commit is contained in:
projectmoon 2021-02-07 21:42:32 +00:00
parent 304c91c69d
commit b0707dff05
1 changed files with 3 additions and 4 deletions

View File

@ -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<String> = errors
.iter()
.map(|&(cmd, err)| format!("<strong>{}:</strong> {}", cmd, err))
.collect::<Vec<_>>()
.join("\n");
.collect();
format!(
"{}: Executed {} commands ({} failed)\n\nFailures:\n{}",
respond_to,
results.len(),
errors.len(),
failures
failures.join("\n")
)
.replace("\n", "<br/>")
};