From 12a60eb189a1f0cabb1f8d17de9904c99dd0ae68 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 19 Jan 2024 00:01:29 +0000 Subject: [PATCH] automatic cargo CI changes --- src/client/mod.rs | 1 + src/common/args.rs | 1 - src/common/conf.rs | 4 ++-- src/server/mod.rs | 10 +++------- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index e69de29..8b13789 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -0,0 +1 @@ + diff --git a/src/common/args.rs b/src/common/args.rs index 9b39244..9a53635 100644 --- a/src/common/args.rs +++ b/src/common/args.rs @@ -46,7 +46,6 @@ pub(crate) struct Cli { #[arg(short, long, default_value_t = false)] pub(crate) server: bool, - // how much threads the server should use #[cfg(feature = "server")] #[arg(short, long, default_value_t = 4)] diff --git a/src/common/conf.rs b/src/common/conf.rs index 0756095..7d44a8a 100644 --- a/src/common/conf.rs +++ b/src/common/conf.rs @@ -40,7 +40,7 @@ impl Display for Mode { pub struct Config { pub addr: std::net::SocketAddr, pub mode: Mode, - pub threads: usize + pub threads: usize, } impl Config { @@ -48,7 +48,7 @@ impl Config { Config { addr: cli.addr.clone(), mode: cli.mode.clone(), - threads: cli.threads + threads: cli.threads, } } } diff --git a/src/server/mod.rs b/src/server/mod.rs index 9aaf850..b2eabe5 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -2,16 +2,12 @@ use anyhow::Result; use libpt::log::{error, info}; use mio::{self, event::Event, net::TcpListener, Events, Interest, Poll, Token}; -use std::{ - io::{prelude::*, BufReader}, - time::Duration, -}; +use std::time::Duration; use threadpool::ThreadPool; -use crate::common::conf::{Config, Mode}; +use crate::common::conf::Config; pub mod listener; -use listener::*; const EVENT_CAPACITY: usize = 128; const SERVER: Token = Token(0); @@ -59,7 +55,7 @@ impl Server { fn handle_event(&self, event: &Event) -> Result<()> { dbg!(event); - let connection = self.server.accept()?; + let _connection = self.server.accept()?; info!("received a connection!"); Ok(()) }