cargo clippy --fix
This commit is contained in:
parent
6485c99167
commit
03cc991bfd
@ -1,4 +1,3 @@
|
|||||||
use std::collections::VecDeque;
|
|
||||||
|
|
||||||
pub struct RadialIterator {
|
pub struct RadialIterator {
|
||||||
radius: i32,
|
radius: i32,
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
use std::{
|
use std::{
|
||||||
io::{Read, Seek},
|
io::{Read, Seek},
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
sync::{atomic::AtomicUsize, Arc},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use flate2::bufread::ZlibDecoder;
|
use flate2::bufread::ZlibDecoder;
|
||||||
@ -9,11 +8,8 @@ use itertools::Itertools;
|
|||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tokio::{
|
use tokio::{
|
||||||
fs::File,
|
|
||||||
io::{AsyncReadExt, AsyncSeekExt},
|
io::{AsyncReadExt, AsyncSeekExt},
|
||||||
runtime::Handle,
|
sync::mpsc,
|
||||||
sync::{mpsc, oneshot, Mutex},
|
|
||||||
task::spawn_blocking,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::chunk::ChunkData;
|
use crate::chunk::ChunkData;
|
||||||
|
|||||||
@ -40,10 +40,8 @@ impl Client {
|
|||||||
if self.protocol_version < CURRENT_MC_PROTOCOL as i32 {
|
if self.protocol_version < CURRENT_MC_PROTOCOL as i32 {
|
||||||
let protocol = self.protocol_version;
|
let protocol = self.protocol_version;
|
||||||
self.kick(&format!("Client outdated ({protocol}), Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
|
self.kick(&format!("Client outdated ({protocol}), Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
|
||||||
return;
|
|
||||||
} else if self.protocol_version > CURRENT_MC_PROTOCOL as i32 {
|
} else if self.protocol_version > CURRENT_MC_PROTOCOL as i32 {
|
||||||
self.kick(&format!("Server outdated, Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
|
self.kick(&format!("Server outdated, Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,19 +32,13 @@ impl<'a> Command<'a> for GamemodeCommand {
|
|||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
// try to parse from number
|
// try to parse from number
|
||||||
match mode_str.parse::<u8>() {
|
if let Ok(i) = mode_str.parse::<u8>() { if let Some(mode) = GameMode::from_u8(i) {
|
||||||
Ok(i) => match GameMode::from_u8(i) {
|
|
||||||
Some(mode) => {
|
|
||||||
player.set_gamemode(mode);
|
player.set_gamemode(mode);
|
||||||
player.send_system_message(
|
player.send_system_message(
|
||||||
format!("Set own game mode to {:?}", mode).into(),
|
format!("Set own game mode to {:?}", mode).into(),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
} }
|
||||||
None => {}
|
|
||||||
},
|
|
||||||
Err(_) => {}
|
|
||||||
}
|
|
||||||
|
|
||||||
player.send_system_message(
|
player.send_system_message(
|
||||||
TextComponent::from("Invalid gamemode")
|
TextComponent::from("Invalid gamemode")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user