follow the clippy lints, they will guide you

This commit is contained in:
missing 2022-06-17 13:35:33 -05:00
parent 35d1b9762f
commit c0a896e7c5

View file

@ -46,24 +46,20 @@ pub async fn irc_loop(
} }
while let Some(orig_message) = stream.next().await.transpose()? { while let Some(orig_message) = stream.next().await.transpose()? {
match orig_message.command { if let Command::Response(response, args) = orig_message.command {
Command::Response(response, args) => { use irc::client::prelude::Response;
use irc::client::prelude::Response;
// if let Response::RPL_NAMREPLY = response { if response == Response::RPL_NAMREPLY {
if response == Response::RPL_NAMREPLY { let channel = args[2].to_string();
let channel = args[2].to_string(); let users = args[3]
let users = args[3] .split(' ')
.split(' ') .map(ToOwned::to_owned)
.map(ToOwned::to_owned) .collect::<Vec<String>>();
.collect::<Vec<String>>();
channel_users.insert(channel, users); channel_users.insert(channel, users);
}
continue;
} }
_ => {}
continue;
}; };
let nickname = unwrap_or_continue!(orig_message.source_nickname()); let nickname = unwrap_or_continue!(orig_message.source_nickname());