From 080f327ab66bc0cbbb2485222fcaae5e956dc877 Mon Sep 17 00:00:00 2001 From: Cain <75994858+cainthebest@users.noreply.github.com> Date: Mon, 25 Aug 2025 12:52:54 +0100 Subject: [PATCH] Maintenance: dep updates and clippy fixs (#243) * chore(deps): update crc32fast to v1.5 * chore(deps): update ureq to v2.12 * chore(deps): update phf to v0.13 * chore(deps): update clap to v4.5 * chore(deps): update lazy_static to v1.5 * chore(deps): update thiserror to v2.0.16 * chore(deps): update clap to v4.5 * chore(deps): update bson to v2.15 * chore(deps): update base64 to v0.22 * chore(deps): update quick-xml to v0.38 * chore(deps): update webbrowser to v1.0 * chore(clippy): fix a load of "variables can be used directly" * chore(ci): update MSRV toolchain to 1.82.0 * chore(pre-commit): update MSRV to 1.82.0 * chore(README): update Minimum Supported Rust Version to 1.82.0 * chore(VERSIONS): update MSRV to 1.82.0 * chore(cli): bump version to 0.4.0 and update MSRV to 1.82.0 * chore(release): bump version to 0.8.0 and update MSRV to 1.82.0 --- .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 2 +- README.md | 4 ++-- VERSIONS.md | 2 +- crates/cli/CHANGELOG.md | 11 +++++++++++ crates/cli/Cargo.toml | 18 +++++++++--------- crates/cli/src/main.rs | 8 ++++---- crates/id-tests/src/lib.rs | 8 ++++---- crates/lib/CHANGELOG.md | 11 +++++++++++ crates/lib/Cargo.toml | 14 +++++++------- crates/lib/src/http.rs | 2 +- crates/lib/src/protocols/unreal2/protocol.rs | 5 ++--- 12 files changed, 54 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4961485..97a3bab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,7 +128,7 @@ jobs: - name: Install MSRV uses: actions-rs/toolchain@v1 with: - toolchain: 1.81.0 + toolchain: 1.82.0 override: true - name: Run MSRV run: cargo check -p gamedig diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0e01d5..8a063b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: language: system files: '([.]rs|Cargo\.toml)$' pass_filenames: false - entry: rustup run --install 1.81.0 cargo check -p gamedig + entry: rustup run --install 1.82.0 cargo check -p gamedig - id: docs name: Check rustdoc compiles diff --git a/README.md b/README.md index 9e6010a..baf570c 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ on Discord. ## Usage -Minimum Supported Rust Version is `1.81.0` and the code is cross-platform. +Minimum Supported Rust Version is `1.82.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 @@ -102,7 +102,7 @@ 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, it has -MSRV of `1.81.0`. +MSRV of `1.82.0`. ## Documentation diff --git a/VERSIONS.md b/VERSIONS.md index 6826097..fdee64d 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -1,6 +1,6 @@ # MSRV (Minimum Supported Rust Version) -Current: `1.81.0` +Current: `1.82.0` Places to update: diff --git a/crates/cli/CHANGELOG.md b/crates/cli/CHANGELOG.md index f6c59f3..f5904c6 100644 --- a/crates/cli/CHANGELOG.md +++ b/crates/cli/CHANGELOG.md @@ -4,6 +4,17 @@ Who knows what the future holds... Nothing... yet. +# 0.4.0 - 24/08/2025 + +### Breaking Changes: + +- MSRV has been updated to `1.82.0` to match the latest `gamedig` version. + +### Changes: + +- Some minor clippy fixes +- Updated dependencies + # 0.3.0 - 23/04/2025 ### Changes: diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index ae93492..2bb9675 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -5,14 +5,14 @@ authors = [ ] description = "A command line interface for gamedig" license = "MIT" -version = "0.3.0" +version = "0.4.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.81.0" +rust-version = "1.82.0" categories = ["command-line-interface"] [features] @@ -31,9 +31,9 @@ browser = ["dep:webbrowser"] [dependencies] # Core Dependencies -thiserror = "2.0.0" -clap = { version = "4.5.4", default-features = false, features = ["derive"] } -gamedig = { version = "0.7.0", default-features = false, features = [ +thiserror = "2.0.16" +clap = { version = "4.5", default-features = false, features = ["derive"] } +gamedig = { version = "0.8.0", default-features = false, features = [ "clap", "games", "game_defs", @@ -44,16 +44,16 @@ gamedig = { version = "0.7.0", default-features = false, features = [ serde = { version = "1", optional = true, default-features = false } # BSON -bson = { version = "2.8.1", optional = true, default-features = false } -base64 = { version = "0.22.0", optional = true, default-features = false, features = ["std"] } +bson = { version = "2.15", optional = true, default-features = false } +base64 = { version = "0.22", optional = true, default-features = false, features = ["std"] } hex = { version = "0.4.3", optional = true, default-features = false } # JSON serde_json = { version = "1", optional = true, default-features = false } # XML -quick-xml = { version = "0.37.0", optional = true, default-features = false } +quick-xml = { version = "0.38", optional = true, default-features = false } # Browser -webbrowser = { version = "1.0.0", optional = true, default-features = false } +webbrowser = { version = "1.0", optional = true, default-features = false } diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index cb4354d..50bd5a8 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -167,7 +167,7 @@ fn resolve_ip_or_domain>(host: T, extra_options: &mut Option Result { // Append a dummy port to perform socket address resolution and then extract the // IP - Ok(format!("{}:0", domain) + Ok(format!("{domain}:0") .to_socket_addrs() .map_err(|_| Error::InvalidHostname(domain.to_string()))? .next() @@ -248,7 +248,7 @@ fn output_result(output_mode: OutputMode, format: Ou /// # Arguments /// * `result` - A result that can be output using the debug formatter. fn output_result_debug(result: R) { - println!("{:#?}", result); + println!("{result:#?}"); } /// Output the result as a JSON object. @@ -374,7 +374,7 @@ fn output_result_xml(result: T) -> Result<()> { let xml_bytes = writer.into_inner(); let xml_string = String::from_utf8(xml_bytes).expect("Failed to convert XML bytes to UTF-8 string"); - println!("{}", xml_string); + println!("{xml_string}"); Ok(()) } @@ -446,7 +446,7 @@ fn main() -> Result<()> { output_result(output_mode, format, result.as_ref()); } Action::Source => { - println!("{}", GAMEDIG_HEADER); + println!("{GAMEDIG_HEADER}"); #[cfg(feature = "browser")] { diff --git a/crates/id-tests/src/lib.rs b/crates/id-tests/src/lib.rs index b42710b..e9fb770 100644 --- a/crates/id-tests/src/lib.rs +++ b/crates/id-tests/src/lib.rs @@ -144,7 +144,7 @@ pub fn test_game_name_rule( .collect() }; - let mut expected_id = format!("{}{}", main, suffix).to_lowercase(); + let mut expected_id = format!("{main}{suffix}").to_lowercase(); if let Some(other_game_name_words) = seen_ids.get(&expected_id) { let mut game_names_same = other_game_name_words.len() == game.words.len(); @@ -166,7 +166,7 @@ pub fn test_game_name_rule( // and 2017 would be swbf22017). rule_stack.push(IDRule::IfIDDuplicateSameGameAppendYearToNewer); - expected_id = format!("{}{}", expected_id, year).to_lowercase(); + expected_id = format!("{expected_id}{year}").to_lowercase(); } else if let Some(protocol) = game.optional_parts.first() { // 7. If a game supports multiple protocols, multiple entries will be done for // said game where the edition/protocol name (first disposable in this order) @@ -199,7 +199,7 @@ pub fn test_game_name_rule( .collect::>() .join(""); - expected_id = format!("{}{}", main, suffix).to_lowercase(); + expected_id = format!("{main}{suffix}").to_lowercase(); } // 8. If its actually about a mod that adds the ability for queries to be @@ -368,7 +368,7 @@ pub fn test_game_name_rules<'a, I: Iterator>(games: I if !wrong_ids.is_empty() { for fail in &wrong_ids { - println!("{:#?}", fail); + println!("{fail:#?}"); } let percentage = (wrong_ids.len() * 100) / game_count; println!( diff --git a/crates/lib/CHANGELOG.md b/crates/lib/CHANGELOG.md index a1f6a0d..035f58f 100644 --- a/crates/lib/CHANGELOG.md +++ b/crates/lib/CHANGELOG.md @@ -2,6 +2,17 @@ Who knows what the future holds... # X.Y.Z - DD/MM/YYYY +# 0.8.0 24/08/2025 + +Breaking: + +- MSRV is now `1.82.0` (was `1.81.0`), this is due to deps we rely on requiring a higher version + +Crate: + +- Some minor clippy fixes +- Updated dependencies + # 0.7.0 - 23/04/2025 Breaking: diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 9aadfa0..85e4dd2 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gamedig" -version = "0.7.0" +version = "0.8.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.81.0" +rust-version = "1.82.0" categories = ["parser-implementations", "parsing", "network-programming", "encoding"] [features] @@ -40,23 +40,23 @@ tls = ["ureq/tls"] [dependencies] byteorder = "1.5" bzip2-rs = "0.1" -crc32fast = "1.4" +crc32fast = "1.5" base64 = "0.22.0" encoding_rs = "0.8" -ureq = { version = "2.9", default-features = false, features = ["gzip", "json"] } +ureq = { version = "2.12", default-features = false, features = ["gzip", "json"] } url = "2" serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0" } -phf = { version = "0.11", optional = true, features = ["macros"] } +phf = { version = "0.13", optional = true, features = ["macros"] } -clap = { version = "4.5.4", optional = true, features = ["derive"] } +clap = { version = "4.5", optional = true, features = ["derive"] } pcap-file = { version = "2.0", optional = true } pnet_packet = { version = "0.35", optional = true } -lazy_static = { version = "1.4", optional = true } +lazy_static = { version = "1.5", optional = true } [dev-dependencies] gamedig-id-tests = { path = "../id-tests", default-features = false } diff --git a/crates/lib/src/http.rs b/crates/lib/src/http.rs index 7986339..fd219fb 100644 --- a/crates/lib/src/http.rs +++ b/crates/lib/src/http.rs @@ -211,7 +211,7 @@ impl HttpClient { Host::Ipv4(ip) => SocketAddr::V4(SocketAddrV4::new(ip, port)), Host::Ipv6(ip) => SocketAddr::V6(SocketAddrV6::new(ip, port, 0, 0)), Host::Domain(domain) => { - format!("{}:{}", domain, port) + format!("{domain}:{port}") .to_socket_addrs() .map_err(|e| HostLookup.context(e))? .next() diff --git a/crates/lib/src/protocols/unreal2/protocol.rs b/crates/lib/src/protocols/unreal2/protocol.rs index 14202bd..5e09d96 100644 --- a/crates/lib/src/protocols/unreal2/protocol.rs +++ b/crates/lib/src/protocols/unreal2/protocol.rs @@ -76,8 +76,7 @@ impl Unreal2Protocol { if packet_type != expected_packet_type { Err(PacketBad.context(format!( - "Packet response ({:?}) didn't match request ({:?}) packet type", - packet_type, expected_packet_type + "Packet response ({packet_type:?}) didn't match request ({expected_packet_type:?}) packet type", ))) } else { Ok(()) @@ -115,7 +114,7 @@ impl Unreal2Protocol { let r = Self::consume_response_headers(&mut buffer, PacketKind::MutatorsAndRules); if r.is_err() { - println!("{:?}", r); + println!("{r:?}"); break; }