From 35d1b9762f38dd607d0ff8216c7f131975257482 Mon Sep 17 00:00:00 2001 From: missing <4a656666official@gmail.com> Date: Fri, 17 Jun 2022 08:10:37 -0500 Subject: [PATCH] move the ACTION handler slightly --- src/irc_discord.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/irc_discord.rs b/src/irc_discord.rs index ab25be7..5f9bc1b 100644 --- a/src/irc_discord.rs +++ b/src/irc_discord.rs @@ -227,13 +227,18 @@ fn irc_to_discord_processing( ) .into_owned(); - computed = { + #[allow(clippy::map_unwrap_or)] + { computed = computed .strip_prefix("\x01ACTION ") .and_then(|s| s.strip_suffix('\x01')) .map(|s| format!("*{}*", s)) .unwrap_or_else(|| computed); // if any step in the way fails, fall back to using computed + } + + computed = { let mut new = String::with_capacity(computed.len()); + let mut has_opened_bold = false; let mut has_opened_italic = false;