forked from projectmoon/tenebrous-dicebot
bot: Move multi-failure response join() call into the format!().
This commit is contained in:
parent
304c91c69d
commit
b0707dff05
|
@ -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/>")
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue