Fix: clippy and fmt

This commit is contained in:
Snowiiii 2024-08-25 13:21:24 +02:00
parent 83aad86005
commit 8cff0b4b76
4 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,6 @@
use std::{ use std::{
io::{self, Write}, io::{self, Write},
net::SocketAddr, net::SocketAddr,
rc::Rc,
sync::Arc, sync::Arc,
}; };

View File

@ -8,7 +8,7 @@ use client::Client;
use commands::handle_command; use commands::handle_command;
use config::AdvancedConfiguration; use config::AdvancedConfiguration;
use std::{collections::HashMap, rc::Rc, thread}; use std::{collections::HashMap, thread};
use client::interrupted; use client::interrupted;
use config::BasicConfiguration; use config::BasicConfiguration;
@ -31,7 +31,7 @@ static ALLOC: dhat::Alloc = dhat::Alloc;
#[cfg(not(target_os = "wasi"))] #[cfg(not(target_os = "wasi"))]
fn main() -> io::Result<()> { fn main() -> io::Result<()> {
use std::{borrow::BorrowMut, sync::{Arc, Mutex}}; use std::sync::{Arc, Mutex};
use entity::player::Player; use entity::player::Player;
use pumpkin_core::text::{color::NamedColor, TextComponent}; use pumpkin_core::text::{color::NamedColor, TextComponent};
@ -59,9 +59,9 @@ fn main() -> io::Result<()> {
rayon::ThreadPoolBuilder::new().build_global().unwrap(); rayon::ThreadPoolBuilder::new().build_global().unwrap();
rt.block_on(async { rt.block_on(async {
const SERVER: Token = Token(0); const SERVER: Token = Token(0);
use std::{cell::RefCell, time::Instant}; use std::time::Instant;
use rcon::RCONServer;
let time = Instant::now(); let time = Instant::now();
let basic_config = BasicConfiguration::load("configuration.toml"); let basic_config = BasicConfiguration::load("configuration.toml");
@ -99,7 +99,7 @@ fn main() -> io::Result<()> {
let mut clients: HashMap<Token, Client> = HashMap::new(); let mut clients: HashMap<Token, Client> = HashMap::new();
let mut players: HashMap<Arc<Token>, Arc<Mutex<Player>>> = HashMap::new(); let mut players: HashMap<Arc<Token>, Arc<Mutex<Player>>> = HashMap::new();
let mut server = Arc::new(Mutex::new(Server::new(( let server = Arc::new(Mutex::new(Server::new((
basic_config, basic_config,
advanced_configuration, advanced_configuration,
)))); ))));

View File

@ -88,7 +88,7 @@ impl RCONServer {
token => { token => {
let done = if let Some(client) = connections.get_mut(&token) { let done = if let Some(client) = connections.get_mut(&token) {
client.handle(&server, &password).await client.handle(server, &password).await
} else { } else {
false false
}; };

View File

@ -1,9 +1,7 @@
use std::{ use std::{
cell::{RefCell, RefMut},
collections::HashMap, collections::HashMap,
io::Cursor, io::Cursor,
path::Path, path::Path,
rc::Rc,
sync::{ sync::{
atomic::{AtomicI32, Ordering}, atomic::{AtomicI32, Ordering},
Arc, Mutex, MutexGuard, Arc, Mutex, MutexGuard,