diff --git a/pumpkin/src/client/mod.rs b/pumpkin/src/client/mod.rs index 5e7e01224..913019b90 100644 --- a/pumpkin/src/client/mod.rs +++ b/pumpkin/src/client/mod.rs @@ -1,7 +1,6 @@ use std::{ io::{self, Write}, net::SocketAddr, - rc::Rc, sync::Arc, }; diff --git a/pumpkin/src/main.rs b/pumpkin/src/main.rs index e95946e6b..9e7429004 100644 --- a/pumpkin/src/main.rs +++ b/pumpkin/src/main.rs @@ -8,7 +8,7 @@ use client::Client; use commands::handle_command; use config::AdvancedConfiguration; -use std::{collections::HashMap, rc::Rc, thread}; +use std::{collections::HashMap, thread}; use client::interrupted; use config::BasicConfiguration; @@ -31,7 +31,7 @@ static ALLOC: dhat::Alloc = dhat::Alloc; #[cfg(not(target_os = "wasi"))] fn main() -> io::Result<()> { - use std::{borrow::BorrowMut, sync::{Arc, Mutex}}; + use std::sync::{Arc, Mutex}; use entity::player::Player; use pumpkin_core::text::{color::NamedColor, TextComponent}; @@ -59,9 +59,9 @@ fn main() -> io::Result<()> { rayon::ThreadPoolBuilder::new().build_global().unwrap(); rt.block_on(async { const SERVER: Token = Token(0); - use std::{cell::RefCell, time::Instant}; + use std::time::Instant; - use rcon::RCONServer; + let time = Instant::now(); let basic_config = BasicConfiguration::load("configuration.toml"); @@ -99,7 +99,7 @@ fn main() -> io::Result<()> { let mut clients: HashMap = HashMap::new(); let mut players: HashMap, Arc>> = HashMap::new(); - let mut server = Arc::new(Mutex::new(Server::new(( + let server = Arc::new(Mutex::new(Server::new(( basic_config, advanced_configuration, )))); diff --git a/pumpkin/src/rcon/mod.rs b/pumpkin/src/rcon/mod.rs index 28f0a486d..d325a6702 100644 --- a/pumpkin/src/rcon/mod.rs +++ b/pumpkin/src/rcon/mod.rs @@ -88,7 +88,7 @@ impl RCONServer { token => { let done = if let Some(client) = connections.get_mut(&token) { - client.handle(&server, &password).await + client.handle(server, &password).await } else { false }; diff --git a/pumpkin/src/server.rs b/pumpkin/src/server.rs index f50af89d6..a33d212a7 100644 --- a/pumpkin/src/server.rs +++ b/pumpkin/src/server.rs @@ -1,9 +1,7 @@ use std::{ - cell::{RefCell, RefMut}, collections::HashMap, io::Cursor, path::Path, - rc::Rc, sync::{ atomic::{AtomicI32, Ordering}, Arc, Mutex, MutexGuard,