diff --git a/src/commands/cap.rs b/src/commands/cap.rs index ac4ef91..b13135a 100644 --- a/src/commands/cap.rs +++ b/src/commands/cap.rs @@ -2,7 +2,6 @@ use async_trait::async_trait; use crate::{ commands::{IrcAction, IrcHandler}, - sender::IrcResponse, user::User, }; @@ -12,7 +11,7 @@ pub struct Cap; impl IrcHandler for Cap { async fn handle( &self, - arguments: Vec, + _arguments: Vec, _authenticated: bool, _user_state: &mut User, ) -> super::IrcAction { diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 80bef2b..9ae9ab9 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -111,25 +111,15 @@ impl IrcCommand { user_state, ) .await; - action.execute(writer, hostname, user_state).await; + action.execute(writer, hostname).await; Ok(()) } } impl IrcAction { - pub async fn execute( - &self, - writer: &mut BufWriter, - hostname: &str, - user_state: &mut User, - ) { + pub async fn execute(&self, writer: &mut BufWriter, hostname: &str) { match self { - /*IrcAction::MultipleActions(actions) => { - for action in actions { - action.execute(writer, hostname, user_state); - } - }*/ IrcAction::SendText(msg) => { msg.send(hostname, writer, false).await.unwrap(); } diff --git a/src/commands/privmsg.rs b/src/commands/privmsg.rs index 0c266c3..488a9ab 100644 --- a/src/commands/privmsg.rs +++ b/src/commands/privmsg.rs @@ -1,5 +1,4 @@ use async_trait::async_trait; -use tokio::sync::broadcast::Sender; use crate::{ CONNECTED_USERS, SENDER, diff --git a/src/main.rs b/src/main.rs index 024fa42..4de7aab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,7 @@ use std::{ - collections::{HashMap, HashSet}, - io::{BufRead, BufReader, BufWriter}, + collections::HashSet, net::{SocketAddr, TcpListener, TcpStream}, str::FromStr, - sync::mpsc, time::Duration, }; diff --git a/src/sender.rs b/src/sender.rs index 8071807..2623d3b 100644 --- a/src/sender.rs +++ b/src/sender.rs @@ -1,5 +1,3 @@ -use std::io::Write; - use anyhow::Result; use tokio::{ io::{AsyncWriteExt, BufWriter},