From c0a896e7c5fa25249b907683f1e4658dbf2e3cdb Mon Sep 17 00:00:00 2001 From: missing <4a656666official@gmail.com> Date: Fri, 17 Jun 2022 13:35:33 -0500 Subject: [PATCH] follow the clippy lints, they will guide you --- src/irc_discord.rs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/irc_discord.rs b/src/irc_discord.rs index 5f9bc1b..6438d04 100644 --- a/src/irc_discord.rs +++ b/src/irc_discord.rs @@ -46,24 +46,20 @@ pub async fn irc_loop( } while let Some(orig_message) = stream.next().await.transpose()? { - match orig_message.command { - Command::Response(response, args) => { - use irc::client::prelude::Response; + if let Command::Response(response, args) = orig_message.command { + use irc::client::prelude::Response; - // if let Response::RPL_NAMREPLY = response { - if response == Response::RPL_NAMREPLY { - let channel = args[2].to_string(); - let users = args[3] - .split(' ') - .map(ToOwned::to_owned) - .collect::>(); + if response == Response::RPL_NAMREPLY { + let channel = args[2].to_string(); + let users = args[3] + .split(' ') + .map(ToOwned::to_owned) + .collect::>(); - channel_users.insert(channel, users); - } - - continue; + channel_users.insert(channel, users); } - _ => {} + + continue; }; let nickname = unwrap_or_continue!(orig_message.source_nickname());