chore: fix warnings

This commit is contained in:
user0-07161 2025-10-02 19:57:38 +02:00
parent 2ae02b4a22
commit 463c9c06da
5 changed files with 4 additions and 20 deletions

View file

@ -2,7 +2,6 @@ use async_trait::async_trait;
use crate::{ use crate::{
commands::{IrcAction, IrcHandler}, commands::{IrcAction, IrcHandler},
sender::IrcResponse,
user::User, user::User,
}; };
@ -12,7 +11,7 @@ pub struct Cap;
impl IrcHandler for Cap { impl IrcHandler for Cap {
async fn handle( async fn handle(
&self, &self,
arguments: Vec<String>, _arguments: Vec<String>,
_authenticated: bool, _authenticated: bool,
_user_state: &mut User, _user_state: &mut User,
) -> super::IrcAction { ) -> super::IrcAction {

View file

@ -111,25 +111,15 @@ impl IrcCommand {
user_state, user_state,
) )
.await; .await;
action.execute(writer, hostname, user_state).await; action.execute(writer, hostname).await;
Ok(()) Ok(())
} }
} }
impl IrcAction { impl IrcAction {
pub async fn execute( pub async fn execute(&self, writer: &mut BufWriter<TcpStream>, hostname: &str) {
&self,
writer: &mut BufWriter<TcpStream>,
hostname: &str,
user_state: &mut User,
) {
match self { match self {
/*IrcAction::MultipleActions(actions) => {
for action in actions {
action.execute(writer, hostname, user_state);
}
}*/
IrcAction::SendText(msg) => { IrcAction::SendText(msg) => {
msg.send(hostname, writer, false).await.unwrap(); msg.send(hostname, writer, false).await.unwrap();
} }

View file

@ -1,5 +1,4 @@
use async_trait::async_trait; use async_trait::async_trait;
use tokio::sync::broadcast::Sender;
use crate::{ use crate::{
CONNECTED_USERS, SENDER, CONNECTED_USERS, SENDER,

View file

@ -1,9 +1,7 @@
use std::{ use std::{
collections::{HashMap, HashSet}, collections::HashSet,
io::{BufRead, BufReader, BufWriter},
net::{SocketAddr, TcpListener, TcpStream}, net::{SocketAddr, TcpListener, TcpStream},
str::FromStr, str::FromStr,
sync::mpsc,
time::Duration, time::Duration,
}; };

View file

@ -1,5 +1,3 @@
use std::io::Write;
use anyhow::Result; use anyhow::Result;
use tokio::{ use tokio::{
io::{AsyncWriteExt, BufWriter}, io::{AsyncWriteExt, BufWriter},