Skip to content

Commit

Permalink
cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Aug 14, 2024
1 parent 6485c99 commit 03cc991
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion pumpkin-world/src/radial_chunk_iterator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::collections::VecDeque;

pub struct RadialIterator {
radius: i32,
Expand Down
6 changes: 1 addition & 5 deletions pumpkin-world/src/world.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
use std::{
io::{Read, Seek},
path::PathBuf,
sync::{atomic::AtomicUsize, Arc},
};

use flate2::bufread::ZlibDecoder;
use itertools::Itertools;
use rayon::prelude::*;
use thiserror::Error;
use tokio::{
fs::File,
io::{AsyncReadExt, AsyncSeekExt},
runtime::Handle,
sync::{mpsc, oneshot, Mutex},
task::spawn_blocking,
sync::mpsc,
};

use crate::chunk::ChunkData;
Expand Down
2 changes: 0 additions & 2 deletions pumpkin/src/client/client_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
20 changes: 7 additions & 13 deletions pumpkin/src/commands/gamemode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 03cc991

Please sign in to comment.