chore: fix warnings
This commit is contained in:
parent
2ae02b4a22
commit
463c9c06da
5 changed files with 4 additions and 20 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
use std::io::Write;
|
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use tokio::{
|
use tokio::{
|
||||||
io::{AsyncWriteExt, BufWriter},
|
io::{AsyncWriteExt, BufWriter},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue