Skip to content

Commit 7acc227

Browse files
committed
Clippy + fmt
1 parent 8ad1965 commit 7acc227

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

src/bin/src/packet_handlers/transform/update_player_position.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use ferrumc_net::errors::NetError;
77
use ferrumc_net::packets::packet_events::TransformEvent;
88
use ferrumc_net::utils::ecs_helpers::EntityExt;
99
use ferrumc_state::GlobalState;
10-
use tracing::{debug, trace};
10+
use tracing::trace;
1111

1212
#[event_handler]
1313
async fn handle_player_move(

src/bin/src/systems/chunk_sender.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ use ferrumc_net::packets::outgoing::set_center_chunk::SetCenterChunk;
1010
use ferrumc_net_codec::encode::NetEncodeOpts;
1111
use ferrumc_net_codec::net_types::var_int::VarInt;
1212
use ferrumc_state::GlobalState;
13-
use rand::random;
1413
use std::sync::atomic::{AtomicBool, Ordering};
1514
use std::sync::Arc;
1615
use std::time::Duration;
1716
use tokio::task::JoinSet;
18-
use tracing::{debug, error, info, trace};
17+
use tracing::{error, info, trace};
1918

2019
pub(super) struct ChunkSenderSystem {
2120
pub stop: AtomicBool,

src/lib/net/crates/codec/src/net_types/network_position.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ impl NetworkPosition {
6868
let mut x = (val >> 38) as i32;
6969
let mut y = (val << 52 >> 52) as i16;
7070
let mut z = (val << 26 >> 38) as i32;
71-
if x >= 1 << 25 { x -= 1 << 26 }
72-
if y >= 1 << 11 { y -= 1 << 12 }
73-
if z >= 1 << 25 { z -= 1 << 26 }
71+
if x >= 1 << 25 {
72+
x -= 1 << 26
73+
}
74+
if y >= 1 << 11 {
75+
y -= 1 << 12
76+
}
77+
if z >= 1 << 25 {
78+
z -= 1 << 26
79+
}
7480
Self { x, y, z }
7581
}
7682
}

src/lib/net/src/packets/incoming/place_block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct PlaceBlock {
2121
}
2222

2323
impl IncomingPacket for PlaceBlock {
24-
async fn handle(self, conn_id: usize, state: Arc<ServerState>) -> NetResult<()> {
24+
async fn handle(self, _conn_id: usize, _state: Arc<ServerState>) -> NetResult<()> {
2525
debug!("{:?}", self);
2626
Ok(())
2727
}

src/lib/net/src/utils/broadcast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::connection::StreamWriter;
22
use crate::NetResult;
33
use async_trait::async_trait;
4-
use ferrumc_core::chunks::chunk_receiver::ChunkReceiver;
54
use ferrumc_core::identity::player_identity::PlayerIdentity;
65
use ferrumc_ecs::entities::Entity;
76
use ferrumc_net_codec::encode::{NetEncode, NetEncodeOpts};

src/lib/utils/general_purpose/src/data_packing/i32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::data_packing::errors::DataPackingError;
1717
///
1818
/// * `DataPackingError::SizeExceedsMaxSize` - If `size` is greater than 32.
1919
/// * `DataPackingError::NotEnoughBits` - If `offset + size` exceeds 64 bits.
20-
/// Reads an n-bit integer from a packed `i64`.
20+
/// Reads an n-bit integer from a packed `i64`.
2121
pub fn read_nbit_i32(
2222
word: &i64,
2323
bit_size: usize,

src/lib/world/src/chunk_format.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ use crate::vanilla_chunk_format;
33
use crate::vanilla_chunk_format::VanillaChunk;
44
use bitcode_derive::{Decode, Encode};
55
use deepsize::DeepSizeOf;
6-
use ferrumc_general_purpose::data_packing::i32::{read_nbit_i32, write_nbit_i32};
6+
use ferrumc_general_purpose::data_packing::i32::read_nbit_i32;
77
use ferrumc_macros::{NBTDeserialize, NBTSerialize};
88
use ferrumc_net_codec::net_types::var_int::VarInt;
99
use lazy_static::lazy_static;
1010
use std::cmp::max;
1111
use std::collections::HashMap;
1212
use std::io::Read;
13-
use tracing::{debug, error};
13+
use tracing::error;
1414
use vanilla_chunk_format::BlockData;
1515

1616
#[cfg(test)]
@@ -285,13 +285,10 @@ impl BlockStates {
285285
new_data.len()
286286
)));
287287
}
288-
289288
// Update the chunk with the new packed data and bit size
290289
self.data = new_data;
291290
self.bits_per_block = new_bit_size as u8;
292291

293-
// debug!("Resize complete. New data: {:?}", self.data);
294-
295292
Ok(())
296293
}
297294
}

0 commit comments

Comments
 (0)