maintenance(workspace): updates and clippy fixs (#242)

This commit is contained in:
Cain 2025-04-23 22:04:37 +01:00 committed by GitHub
commit 350f297193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 50 additions and 33 deletions

View file

@ -128,7 +128,7 @@ jobs:
- name: Install MSRV - name: Install MSRV
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: 1.71.1 toolchain: 1.81.0
override: true override: true
- name: Run MSRV - name: Run MSRV
run: cargo check -p gamedig run: cargo check -p gamedig
@ -151,7 +151,7 @@ jobs:
- name: Install Formatting nightly - name: Install Formatting nightly
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly-2023-07-09 toolchain: nightly-2025-04-19
components: rustfmt components: rustfmt
override: true override: true
- name: Run Formatting check - name: Run Formatting check

View file

@ -8,7 +8,7 @@ repos:
language: system language: system
files: '([.]rs|Cargo\.toml)$' files: '([.]rs|Cargo\.toml)$'
pass_filenames: false pass_filenames: false
entry: rustup run --install nightly-2023-07-09 cargo-clippy -- --workspace --all-features -- -D warnings entry: rustup run --install nightly-2025-04-19 cargo-clippy -- --workspace --all-features -- -D warnings
- id: build-no-features - id: build-no-features
name: Check crate build with no features name: Check crate build with no features
@ -36,14 +36,14 @@ repos:
language: system language: system
files: '([.]rs|Cargo\.toml)$' files: '([.]rs|Cargo\.toml)$'
pass_filenames: false pass_filenames: false
entry: rustup run --install nightly-2023-07-09 cargo-fmt --check entry: rustup run --install nightly-2025-04-19 cargo-fmt --check
- id: msrv - id: msrv
name: Check MSRV compiles (lib only) name: Check MSRV compiles (lib only)
language: system language: system
files: '([.]rs|Cargo\.toml)$' files: '([.]rs|Cargo\.toml)$'
pass_filenames: false pass_filenames: false
entry: rustup run --install 1.71.1 cargo check -p gamedig entry: rustup run --install 1.81.0 cargo check -p gamedig
- id: docs - id: docs
name: Check rustdoc compiles name: Check rustdoc compiles

View file

@ -27,7 +27,7 @@ format_macro_bodies = true
format_strings = true format_strings = true
group_imports = "Preserve" group_imports = "Preserve"
hard_tabs = false hard_tabs = false
hide_parse_errors = false show_parse_errors = true
hex_literal_case = "Preserve" hex_literal_case = "Preserve"
ignore = [] ignore = []
indent_style = "Block" indent_style = "Block"
@ -48,7 +48,7 @@ overflow_delimited_expr = false
reorder_impl_items = false reorder_impl_items = false
reorder_imports = true reorder_imports = true
reorder_modules = true reorder_modules = true
required_version = "1.6.0" required_version = "1.8.0"
short_array_element_width_threshold = 10 short_array_element_width_threshold = 10
single_line_if_else_max_width = 50 single_line_if_else_max_width = 50
skip_children = false skip_children = false
@ -67,6 +67,6 @@ unstable_features = false
use_field_init_shorthand = false use_field_init_shorthand = false
use_small_heuristics = "Default" use_small_heuristics = "Default"
use_try_shorthand = true use_try_shorthand = true
version = "Two" style_edition = "2021"
where_single_line = true where_single_line = true
wrap_comments = true wrap_comments = true

View file

@ -39,7 +39,7 @@ on Discord.
## Usage ## Usage
Minimum Supported Rust Version is `1.71.1"` and the code is cross-platform. Minimum Supported Rust Version is `1.81.0` and the code is cross-platform.
Pick a game/service/protocol (check the [GAMES](GAMES.md), [SERVICES](SERVICES.md) and [PROTOCOLS](PROTOCOLS.md) files Pick a game/service/protocol (check the [GAMES](GAMES.md), [SERVICES](SERVICES.md) and [PROTOCOLS](PROTOCOLS.md) files
to see the currently supported ones), provide the ip and the port (be aware that some game servers use a separate port to see the currently supported ones), provide the ip and the port (be aware that some game servers use a separate port
@ -101,8 +101,8 @@ Want to see more examples? Checkout the [examples](crates/lib/examples) folder.
## Command Line Interface ## Command Line Interface
The library also has an [official CLI](https://crates.io/crates/gamedig_cli) that you can use but it has The library also has an [official CLI](https://crates.io/crates/gamedig_cli) that you can use, it has
MSRV of `1.74.1`. MSRV of `1.81.0`.
## Documentation ## Documentation

View file

@ -1,6 +1,6 @@
# MSRV (Minimum Supported Rust Version) # MSRV (Minimum Supported Rust Version)
Current: `1.71.1` Current: `1.81.0`
Places to update: Places to update:
@ -11,7 +11,7 @@ Places to update:
# rustfmt version # rustfmt version
Current: `1.6.0` Current: `1.8.0`
Places to update: Places to update:
@ -22,7 +22,7 @@ Places to update:
The toolchain version used to run rustfmt in CI The toolchain version used to run rustfmt in CI
Current: `nightly-2023-07-09` Current: `nightly-2025-04-19`
Places to update: Places to update:

View file

@ -4,6 +4,16 @@ Who knows what the future holds...
Nothing... yet. Nothing... yet.
# 0.3.0 - 23/04/2025
### Changes:
- CLI now uses `gamedig` v0.7.0 (To update, run `cargo install gamedig_cli`).
### Breaking Changes:
- MSRV has been updated to `1.81.0` to match the latest `gamedig` version.
# 0.2.1 - 05/12/2024 # 0.2.1 - 05/12/2024
Dependencies: Dependencies:

View file

@ -5,14 +5,14 @@ authors = [
] ]
description = "A command line interface for gamedig" description = "A command line interface for gamedig"
license = "MIT" license = "MIT"
version = "0.2.1" version = "0.3.0"
edition = "2021" edition = "2021"
default-run = "gamedig_cli" default-run = "gamedig_cli"
homepage = "https://gamedig.github.io/" homepage = "https://gamedig.github.io/"
repository = "https://github.com/gamedig/rust-gamedig" repository = "https://github.com/gamedig/rust-gamedig"
readme = "README.md" readme = "README.md"
keywords = ["server", "query", "game", "check", "status"] keywords = ["server", "query", "game", "check", "status"]
rust-version = "1.74.1" rust-version = "1.81.0"
categories = ["command-line-interface"] categories = ["command-line-interface"]
[features] [features]
@ -33,7 +33,7 @@ browser = ["dep:webbrowser"]
# Core Dependencies # Core Dependencies
thiserror = "2.0.0" thiserror = "2.0.0"
clap = { version = "4.5.4", default-features = false, features = ["derive"] } clap = { version = "4.5.4", default-features = false, features = ["derive"] }
gamedig = { version = "0.6.1", default-features = false, features = [ gamedig = { version = "0.7.0", default-features = false, features = [
"clap", "clap",
"games", "games",
"game_defs", "game_defs",

View file

@ -2,12 +2,20 @@ Who knows what the future holds...
# X.Y.Z - DD/MM/YYYY # X.Y.Z - DD/MM/YYYY
# 0.6.2 - DD/MM/YYYY # 0.7.0 - 23/04/2025
Breaking:
- MSRV is now `1.81.0` (was `1.71.1`), this is due to deps we rely on requiring a higher version
Games: Games:
- Added `Arma 3` support (by @Perondas). - Added `Arma 3` support (by @Perondas).
Crate:
- Some minor clippy fixes
# 0.6.1 - 05/12/2024 # 0.6.1 - 05/12/2024
Games: Games:

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gamedig" name = "gamedig"
version = "0.6.1" version = "0.7.0"
edition = "2021" edition = "2021"
authors = [ authors = [
"rust-GameDig contributors [https://github.com/gamedig/rust-gamedig/contributors]", "rust-GameDig contributors [https://github.com/gamedig/rust-gamedig/contributors]",
@ -13,7 +13,7 @@ documentation = "https://docs.rs/gamedig/latest/gamedig/"
repository = "https://github.com/gamedig/rust-gamedig" repository = "https://github.com/gamedig/rust-gamedig"
readme = "README.md" readme = "README.md"
keywords = ["server", "query", "game", "check", "status"] keywords = ["server", "query", "game", "check", "status"]
rust-version = "1.71.1" rust-version = "1.81.0"
categories = ["parser-implementations", "parsing", "network-programming", "encoding"] categories = ["parser-implementations", "parsing", "network-programming", "encoding"]
[features] [features]

View file

@ -36,7 +36,7 @@ on Discord.
## Usage ## Usage
Minimum Supported Rust Version is `1.71.1` and the code is cross-platform. Minimum Supported Rust Version is `1.81.0` and the code is cross-platform.
Pick a game/service/protocol (check Pick a game/service/protocol (check
the [GAMES](https://github.com/gamedig/rust-gamedig/blob/main/GAMES.md), [SERVICES](https://github.com/gamedig/rust-gamedig/blob/main/SERVICES.md) the [GAMES](https://github.com/gamedig/rust-gamedig/blob/main/GAMES.md), [SERVICES](https://github.com/gamedig/rust-gamedig/blob/main/SERVICES.md)

View file

@ -132,14 +132,13 @@ impl<'a, B: ByteOrder> Buffer<'a, B> {
/// # Type Parameters /// # Type Parameters
/// ///
/// * `D` - The type of string decoder to use. This type must implement the /// * `D` - The type of string decoder to use. This type must implement the
/// `StringDecoder` trait with the same byte order as the buffer. /// `StringDecoder` trait with the same byte order as the buffer.
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `until` - An optional delimiter. If provided, the method will read /// * `until` - An optional delimiter. If provided, the method will read
/// until this /// until this delimiter is encountered. If not provided, the method will
/// delimiter is encountered. If not provided, the method will read until /// read until the default delimiter of the decoder.
/// the default delimiter of the decoder.
/// ///
/// # Errors /// # Errors
/// ///

View file

@ -40,7 +40,7 @@ pub fn query_with_timeout(
let environment_type = Environment::from_gldsrc(buffer.read::<u8>()?)?; let environment_type = Environment::from_gldsrc(buffer.read::<u8>()?)?;
let has_password = buffer.read::<u8>()? == 1; let has_password = buffer.read::<u8>()? == 1;
let vac_secured = buffer.read::<u8>()? == 1; let vac_secured = buffer.read::<u8>()? == 1;
buffer.move_cursor(1)?; //average fps buffer.move_cursor(1)?; // average fps
let round = buffer.read::<u8>()?; let round = buffer.read::<u8>()?;
let rounds_maximum = buffer.read::<u8>()?; let rounds_maximum = buffer.read::<u8>()?;
let time_left = buffer.read::<u16>()?; let time_left = buffer.read::<u16>()?;

View file

@ -165,7 +165,7 @@ impl GameSpy3 {
let id = buf.read::<u8>()?; let id = buf.read::<u8>()?;
let is_last = (id & 0x80) > 0; let is_last = (id & 0x80) > 0;
let packet_id = (id & 0x7f) as usize; 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() { if is_last && packet_id + 1 != values.len() {
reached_expected_packets_size = true; reached_expected_packets_size = true;

View file

@ -33,7 +33,7 @@ use std::collections::HashMap;
use std::net::SocketAddr; use std::net::SocketAddr;
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)] //remove this later on #[allow(dead_code)] // remove this later on
struct SplitPacket { struct SplitPacket {
pub header: u32, pub header: u32,
pub id: u32, pub id: u32,
@ -48,7 +48,7 @@ struct SplitPacket {
impl SplitPacket { impl SplitPacket {
fn new(engine: &Engine, protocol: u8, buffer: &mut Buffer<LittleEndian>) -> GDResult<Self> { fn new(engine: &Engine, protocol: u8, buffer: &mut Buffer<LittleEndian>) -> GDResult<Self> {
let header = buffer.read()?; //buffer.get_u32()?; let header = buffer.read()?; // buffer.get_u32()?;
let id = buffer.read()?; let id = buffer.read()?;
let (total, number, size, decompressed) = match engine { let (total, number, size, decompressed) = match engine {
Engine::GoldSrc(_) => { Engine::GoldSrc(_) => {
@ -218,8 +218,8 @@ impl ValveProtocol {
} }
fn get_goldsrc_server_info(buffer: &mut Buffer<LittleEndian>) -> GDResult<ServerInfo> { fn get_goldsrc_server_info(buffer: &mut Buffer<LittleEndian>) -> GDResult<ServerInfo> {
let _header: u8 = buffer.read()?; //get the header (useless info) let _header: u8 = buffer.read()?; // get the header (useless info)
let _address: String = buffer.read_string::<Utf8Decoder>(None)?; //get the server address (useless info) let _address: String = buffer.read_string::<Utf8Decoder>(None)?; // get the server address (useless info)
let name = buffer.read_string::<Utf8Decoder>(None)?; let name = buffer.read_string::<Utf8Decoder>(None)?;
let map = buffer.read_string::<Utf8Decoder>(None)?; let map = buffer.read_string::<Utf8Decoder>(None)?;
let folder = buffer.read_string::<Utf8Decoder>(None)?; let folder = buffer.read_string::<Utf8Decoder>(None)?;
@ -381,7 +381,7 @@ impl ValveProtocol {
let mut players: Vec<ServerPlayer> = Vec::with_capacity(count); let mut players: Vec<ServerPlayer> = Vec::with_capacity(count);
for _ in 0 .. count { for _ in 0 .. count {
buffer.move_cursor(1)?; //skip the index byte buffer.move_cursor(1)?; // skip the index byte
players.push(ServerPlayer { players.push(ServerPlayer {
name: buffer.read_string::<Utf8Decoder>(None)?, name: buffer.read_string::<Utf8Decoder>(None)?,

View file

@ -30,7 +30,7 @@ fn construct_payload(region: Region, filters: &Option<SearchFilters>, last_ip: &
// The last fetched ip as a string // The last fetched ip as a string
last_ip.as_bytes(), last_ip.as_bytes(),
// Followed by an ':' // Followed by an ':'
&[b':'], b":",
// And the port, as a string // And the port, as a string
last_port.to_string().as_bytes(), last_port.to_string().as_bytes(),
// Which needs to end with a NULL byte // Which needs to end with a NULL byte