fix(ci): clear RUSTFLAGS=-D warnings lints + cargo fmt sweep#1
Merged
Conversation
CI was failing on commit 0ea6200 (M2-M6) with build errors on all three platforms. Two of the steps ('Build workspace' and 'Run unit tests') fired because `RUSTFLAGS: -D warnings` upgraded pre-existing warnings to errors in code that the author never compiled with -D warnings. The third CI step ('Lint (clippy, deny warnings)') was never reached in the failed run, so it surfaced only when the build was fixed locally. Cleaning that up revealed the same class of issues across multiple crates — all stemming from the same M2-M6 commit. This commit makes every CI step green: Build / test fixes (the 3 errors the user originally hit): - crates/idgen/src/lib.rs — drop 'mut' on 2 test variables - sdk-rust/examples/batch.rs — drop unused ProbeInput, ProbeMode Clippy -D warnings fixes (8 additional lints): - crates/matchr/src/lib.rs — &[q.clone()] → slice::from_ref - crates/probe/src/nmap_probes.rs — drop redundant 'as u16' - crates/ouidb/src/lib.rs — drop redundant .into() on u8 - crates/datastore/src/lib.rs — len() > 0 → !is_empty() - crates/branddb/src/lib.rs — to_ascii_lowercase() == → eq_ignore_ascii_case() - crates/ffi-c/src/brand.rs — drop 2 redundant .into() to String; allow field_reassign_with_default on the function (the conditional branch logic makes struct-literal init awkward) - crates/ffi-c/src/scan.rs — for i in 0..n → iter().take(n).enumerate() - crates/ffi-c/src/types.rs — add # Safety section to read_c_str Branddb OUI hex literal lints (preserved values, not blindly accepted): - crates/branddb/src/builtin.rs — #[allow(mistyped_literal_suffixes)] on the RULES static + #[rustfmt::skip] to prevent re-bloat of the 5000-rule data table - crates/branddb/src/yaml.rs — #[allow(unusual_byte_groupings)] on the oui_yaml_roundtrip test The OUI lints are tricky: clippy thinks 0xC4_65_16 should be 0xC465_u16 (and similar), but accepting that suggestion would change the value (24-bit OUI prefix becoming a 16-bit one) and break vendor matching. Comments at the allow sites explain why. Format check (cargo fmt --check): - workspace-wide rustfmt sweep; most of the diff in crates/branddb/src/yaml.rs is a one-time alignment cleanup of the same OUI test fixtures. Verified locally on windows-2022: - RUSTFLAGS=-D warnings cargo test --workspace → 256 passed, 0 failed - cargo clippy --workspace --all-targets -- -D warnings → clean - cargo fmt --all -- --check → clean Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI was failing on commit 0ea6200 (M2-M6) with build errors on all three platforms. Two of the steps ('Build workspace' and 'Run unit tests') fired because
RUSTFLAGS: -D warningsupgraded pre-existing warnings to errors in code that the author never compiled with -D warnings.The third CI step ('Lint (clippy, deny warnings)') was never reached in the failed run, so it surfaced only when the build was fixed locally. Cleaning that up revealed the same class of issues across multiple crates — all stemming from the same M2-M6 commit.
This commit makes every CI step green:
Build / test fixes (the 3 errors the user originally hit):
Clippy -D warnings fixes (8 additional lints):
allow field_reassign_with_default on the
function (the conditional branch logic
makes struct-literal init awkward)
Branddb OUI hex literal lints (preserved values, not blindly accepted):
on the RULES static + #[rustfmt::skip]
to prevent re-bloat of the 5000-rule
data table
on the oui_yaml_roundtrip test
The OUI lints are tricky: clippy thinks 0xC4_65_16 should be 0xC465_u16 (and similar), but accepting that suggestion would change the value (24-bit OUI prefix becoming a 16-bit one) and break vendor matching. Comments at the allow sites explain why.
Format check (cargo fmt --check):
Verified locally on windows-2022: