From 8160a866b02190cbd0ba55caa746e10ca4dbe447 Mon Sep 17 00:00:00 2001 From: Cain <75994858+cainthebest@users.noreply.github.com> Date: Sun, 20 Apr 2025 23:06:55 +0100 Subject: [PATCH] chore(format): with new config --- crates/lib/src/buffer.rs | 5 ++--- crates/lib/src/games/ffow/protocol.rs | 2 +- .../src/protocols/gamespy/protocols/three/protocol.rs | 2 +- crates/lib/src/protocols/valve/protocol.rs | 10 +++++----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/lib/src/buffer.rs b/crates/lib/src/buffer.rs index 49d1c3f..dff7cf0 100644 --- a/crates/lib/src/buffer.rs +++ b/crates/lib/src/buffer.rs @@ -137,9 +137,8 @@ impl<'a, B: ByteOrder> Buffer<'a, B> { /// # Arguments /// /// * `until` - An optional delimiter. If provided, the method will read - /// until this - /// delimiter is encountered. If not provided, the method will read until - /// the default delimiter of the decoder. + /// until this delimiter is encountered. If not provided, the method will + /// read until the default delimiter of the decoder. /// /// # Errors /// diff --git a/crates/lib/src/games/ffow/protocol.rs b/crates/lib/src/games/ffow/protocol.rs index 9eb7423..95899d0 100644 --- a/crates/lib/src/games/ffow/protocol.rs +++ b/crates/lib/src/games/ffow/protocol.rs @@ -40,7 +40,7 @@ pub fn query_with_timeout( let environment_type = Environment::from_gldsrc(buffer.read::()?)?; let has_password = buffer.read::()? == 1; let vac_secured = buffer.read::()? == 1; - buffer.move_cursor(1)?; //average fps + buffer.move_cursor(1)?; // average fps let round = buffer.read::()?; let rounds_maximum = buffer.read::()?; let time_left = buffer.read::()?; diff --git a/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs b/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs index 1609a29..6e40320 100644 --- a/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs +++ b/crates/lib/src/protocols/gamespy/protocols/three/protocol.rs @@ -165,7 +165,7 @@ impl GameSpy3 { let id = buf.read::()?; let is_last = (id & 0x80) > 0; let packet_id = (id & 0x7f) as usize; - buf.move_cursor(1)?; //unknown byte regarding packet no. + buf.move_cursor(1)?; // unknown byte regarding packet no. if is_last && packet_id + 1 != values.len() { reached_expected_packets_size = true; diff --git a/crates/lib/src/protocols/valve/protocol.rs b/crates/lib/src/protocols/valve/protocol.rs index 042079c..04a83ea 100644 --- a/crates/lib/src/protocols/valve/protocol.rs +++ b/crates/lib/src/protocols/valve/protocol.rs @@ -33,7 +33,7 @@ use std::collections::HashMap; use std::net::SocketAddr; #[derive(Debug)] -#[allow(dead_code)] //remove this later on +#[allow(dead_code)] // remove this later on struct SplitPacket { pub header: u32, pub id: u32, @@ -48,7 +48,7 @@ struct SplitPacket { impl SplitPacket { fn new(engine: &Engine, protocol: u8, buffer: &mut Buffer) -> GDResult { - let header = buffer.read()?; //buffer.get_u32()?; + let header = buffer.read()?; // buffer.get_u32()?; let id = buffer.read()?; let (total, number, size, decompressed) = match engine { Engine::GoldSrc(_) => { @@ -218,8 +218,8 @@ impl ValveProtocol { } fn get_goldsrc_server_info(buffer: &mut Buffer) -> GDResult { - let _header: u8 = buffer.read()?; //get the header (useless info) - let _address: String = buffer.read_string::(None)?; //get the server address (useless info) + let _header: u8 = buffer.read()?; // get the header (useless info) + let _address: String = buffer.read_string::(None)?; // get the server address (useless info) let name = buffer.read_string::(None)?; let map = buffer.read_string::(None)?; let folder = buffer.read_string::(None)?; @@ -381,7 +381,7 @@ impl ValveProtocol { let mut players: Vec = Vec::with_capacity(count); for _ in 0 .. count { - buffer.move_cursor(1)?; //skip the index byte + buffer.move_cursor(1)?; // skip the index byte players.push(ServerPlayer { name: buffer.read_string::(None)?,