cargo clippy --fix
This commit is contained in:
1 parent
6485c99167
commit
03cc991bfd
4 files changed
+8
-21
No files matched your search
@@ -40,10 +40,8 @@ impl Client {
|
||||
if self.protocol_version < CURRENT_MC_PROTOCOL as i32 {
|
||||
let protocol = self.protocol_version;
|
||||
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 {
|
||||
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(_) => {
|
||||
// try to parse from number
|
||||
match mode_str.parse::<u8>() {
|
||||
Ok(i) => match GameMode::from_u8(i) {
|
||||
Some(mode) => {
|
||||
player.set_gamemode(mode);
|
||||
player.send_system_message(
|
||||
format!("Set own game mode to {:?}", mode).into(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
None => {}
|
||||
},
|
||||
Err(_) => {}
|
||||
}
|
||||
if let Ok(i) = mode_str.parse::<u8>() { if let Some(mode) = GameMode::from_u8(i) {
|
||||
player.set_gamemode(mode);
|
||||
player.send_system_message(
|
||||
format!("Set own game mode to {:?}", mode).into(),
|
||||
);
|
||||
return;
|
||||
} }
|
||||
|
||||
player.send_system_message(
|
||||
TextComponent::from("Invalid gamemode")
|
||||
|
||||
Reference in new issue
Block a user