mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 07:17:27 +00:00
maintenance(workspace): updates and clippy fixs (#242)
This commit is contained in:
commit
350f297193
15 changed files with 50 additions and 33 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -128,7 +128,7 @@ jobs:
|
|||
- name: Install MSRV
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.71.1
|
||||
toolchain: 1.81.0
|
||||
override: true
|
||||
- name: Run MSRV
|
||||
run: cargo check -p gamedig
|
||||
|
|
@ -151,7 +151,7 @@ jobs:
|
|||
- name: Install Formatting nightly
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly-2023-07-09
|
||||
toolchain: nightly-2025-04-19
|
||||
components: rustfmt
|
||||
override: true
|
||||
- name: Run Formatting check
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ repos:
|
|||
language: system
|
||||
files: '([.]rs|Cargo\.toml)$'
|
||||
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
|
||||
name: Check crate build with no features
|
||||
|
|
@ -36,14 +36,14 @@ repos:
|
|||
language: system
|
||||
files: '([.]rs|Cargo\.toml)$'
|
||||
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
|
||||
name: Check MSRV compiles (lib only)
|
||||
language: system
|
||||
files: '([.]rs|Cargo\.toml)$'
|
||||
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
|
||||
name: Check rustdoc compiles
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ format_macro_bodies = true
|
|||
format_strings = true
|
||||
group_imports = "Preserve"
|
||||
hard_tabs = false
|
||||
hide_parse_errors = false
|
||||
show_parse_errors = true
|
||||
hex_literal_case = "Preserve"
|
||||
ignore = []
|
||||
indent_style = "Block"
|
||||
|
|
@ -48,7 +48,7 @@ overflow_delimited_expr = false
|
|||
reorder_impl_items = false
|
||||
reorder_imports = true
|
||||
reorder_modules = true
|
||||
required_version = "1.6.0"
|
||||
required_version = "1.8.0"
|
||||
short_array_element_width_threshold = 10
|
||||
single_line_if_else_max_width = 50
|
||||
skip_children = false
|
||||
|
|
@ -67,6 +67,6 @@ unstable_features = false
|
|||
use_field_init_shorthand = false
|
||||
use_small_heuristics = "Default"
|
||||
use_try_shorthand = true
|
||||
version = "Two"
|
||||
style_edition = "2021"
|
||||
where_single_line = true
|
||||
wrap_comments = true
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ on Discord.
|
|||
|
||||
## 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
|
||||
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
|
||||
|
||||
The library also has an [official CLI](https://crates.io/crates/gamedig_cli) that you can use but it has
|
||||
MSRV of `1.74.1`.
|
||||
The library also has an [official CLI](https://crates.io/crates/gamedig_cli) that you can use, it has
|
||||
MSRV of `1.81.0`.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# MSRV (Minimum Supported Rust Version)
|
||||
|
||||
Current: `1.71.1`
|
||||
Current: `1.81.0`
|
||||
|
||||
Places to update:
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ Places to update:
|
|||
|
||||
# rustfmt version
|
||||
|
||||
Current: `1.6.0`
|
||||
Current: `1.8.0`
|
||||
|
||||
Places to update:
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ Places to update:
|
|||
|
||||
The toolchain version used to run rustfmt in CI
|
||||
|
||||
Current: `nightly-2023-07-09`
|
||||
Current: `nightly-2025-04-19`
|
||||
|
||||
Places to update:
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,16 @@ Who knows what the future holds...
|
|||
|
||||
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
|
||||
|
||||
Dependencies:
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ authors = [
|
|||
]
|
||||
description = "A command line interface for gamedig"
|
||||
license = "MIT"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
default-run = "gamedig_cli"
|
||||
homepage = "https://gamedig.github.io/"
|
||||
repository = "https://github.com/gamedig/rust-gamedig"
|
||||
readme = "README.md"
|
||||
keywords = ["server", "query", "game", "check", "status"]
|
||||
rust-version = "1.74.1"
|
||||
rust-version = "1.81.0"
|
||||
categories = ["command-line-interface"]
|
||||
|
||||
[features]
|
||||
|
|
@ -33,7 +33,7 @@ browser = ["dep:webbrowser"]
|
|||
# Core Dependencies
|
||||
thiserror = "2.0.0"
|
||||
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",
|
||||
"games",
|
||||
"game_defs",
|
||||
|
|
|
|||
|
|
@ -2,12 +2,20 @@ Who knows what the future holds...
|
|||
|
||||
# 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:
|
||||
|
||||
- Added `Arma 3` support (by @Perondas).
|
||||
|
||||
Crate:
|
||||
|
||||
- Some minor clippy fixes
|
||||
|
||||
# 0.6.1 - 05/12/2024
|
||||
|
||||
Games:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gamedig"
|
||||
version = "0.6.1"
|
||||
version = "0.7.0"
|
||||
edition = "2021"
|
||||
authors = [
|
||||
"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"
|
||||
readme = "README.md"
|
||||
keywords = ["server", "query", "game", "check", "status"]
|
||||
rust-version = "1.71.1"
|
||||
rust-version = "1.81.0"
|
||||
categories = ["parser-implementations", "parsing", "network-programming", "encoding"]
|
||||
|
||||
[features]
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ on Discord.
|
|||
|
||||
## 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](https://github.com/gamedig/rust-gamedig/blob/main/GAMES.md), [SERVICES](https://github.com/gamedig/rust-gamedig/blob/main/SERVICES.md)
|
||||
|
|
|
|||
|
|
@ -132,14 +132,13 @@ impl<'a, B: ByteOrder> Buffer<'a, B> {
|
|||
/// # Type Parameters
|
||||
///
|
||||
/// * `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
|
||||
///
|
||||
/// * `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
|
||||
///
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ pub fn query_with_timeout(
|
|||
let environment_type = Environment::from_gldsrc(buffer.read::<u8>()?)?;
|
||||
let has_password = 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 rounds_maximum = buffer.read::<u8>()?;
|
||||
let time_left = buffer.read::<u16>()?;
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ impl GameSpy3 {
|
|||
let id = buf.read::<u8>()?;
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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<LittleEndian>) -> GDResult<Self> {
|
||||
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<LittleEndian>) -> GDResult<ServerInfo> {
|
||||
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 _header: u8 = buffer.read()?; // get the header (useless info)
|
||||
let _address: String = buffer.read_string::<Utf8Decoder>(None)?; // get the server address (useless info)
|
||||
let name = buffer.read_string::<Utf8Decoder>(None)?;
|
||||
let map = 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);
|
||||
|
||||
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::<Utf8Decoder>(None)?,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ fn construct_payload(region: Region, filters: &Option<SearchFilters>, last_ip: &
|
|||
// The last fetched ip as a string
|
||||
last_ip.as_bytes(),
|
||||
// Followed by an ':'
|
||||
&[b':'],
|
||||
b":",
|
||||
// And the port, as a string
|
||||
last_port.to_string().as_bytes(),
|
||||
// Which needs to end with a NULL byte
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue