From df39447da8ed9d0b11d58a9c8a01a00d60a53525 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 4 May 2026 09:56:17 +0800 Subject: [PATCH 1/4] pldm-fw: ignore clippy::collapsible_match collapsible_match was extended to cover if statements. The existing code intent is clearer than with collapsed statements, so disable the check. clippy changed in https://github.com/rust-lang/rust-clippy/pull/16560 Signed-off-by: Matt Johnston --- pldm-fw/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pldm-fw/src/lib.rs b/pldm-fw/src/lib.rs index 0a659ea..97e3bd7 100644 --- a/pldm-fw/src/lib.rs +++ b/pldm-fw/src/lib.rs @@ -8,6 +8,10 @@ #![forbid(unsafe_code)] // #![warn(missing_docs)] +// collapsible_match lint suggests moving `if` statements into the parent +// `match` arms, but that makes code intent less clear. +#![allow(clippy::collapsible_match)] + use core::fmt; use log::debug; From 8b6abf9fc93843273c288be73b2d02828c620c79 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 4 May 2026 10:09:23 +0800 Subject: [PATCH 2/4] pldm-platform: fix redundant reference lint Reported by newer clippy Signed-off-by: Matt Johnston --- pldm-platform/src/proto.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pldm-platform/src/proto.rs b/pldm-platform/src/proto.rs index b12677b..ff73954 100644 --- a/pldm-platform/src/proto.rs +++ b/pldm-platform/src/proto.rs @@ -431,7 +431,7 @@ impl StateDebug { impl Debug for StateDebug { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { if let Some(v) = T::from_u8(self.state) { - write!(f, "{} {:?}", self.state, &v) + write!(f, "{} {:?}", self.state, v) } else { write!(f, "{} (unrecognised state)", self.state) } From 71c3d67047092410342b33a721d289322d0367a8 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 4 May 2026 10:09:52 +0800 Subject: [PATCH 3/4] pldm: fix width format printing completion code {:#02x} format unexpectedly doesn't produce width 2. Instead use a manual 0x{:02x}. Reported by newer clippy. Signed-off-by: Matt Johnston --- pldm/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pldm/src/lib.rs b/pldm/src/lib.rs index aab261d..a7493be 100644 --- a/pldm/src/lib.rs +++ b/pldm/src/lib.rs @@ -60,7 +60,7 @@ impl core::fmt::Display for PldmError { Self::InvalidArgument => write!(f, "Invalid Argument"), Self::NoSpace => write!(f, "Insufficient buffer space available"), Self::CompletionCode(c) => { - write!(f, "Error completion code {c:#02x} received") + write!(f, "Error completion code 0x{c:02x} received") } } } From cfa4167d0a80ad0a5c943004ded485f7b1c25d4d Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 4 May 2026 09:50:22 +0800 Subject: [PATCH 4/4] ci: build against Rust nightly separately to PRs Rust nightly may fail for spurious reasons or new clippy lints. Move the nightly version to a separate workflow that runs on a timer so that it doesn't create noise for PRs. Signed-off-by: Matt Johnston --- .github/workflows/nightly-daily.yml | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/nightly-daily.yml diff --git a/.github/workflows/nightly-daily.yml b/.github/workflows/nightly-daily.yml new file mode 100644 index 0000000..d07e399 --- /dev/null +++ b/.github/workflows/nightly-daily.yml @@ -0,0 +1,45 @@ +# Run CI with Rust nightly builds to notice breakage early. + +name: nightly-daily +on: + schedule: + - cron: "8 20 * * *" + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + ci: + strategy: + matrix: + - rust_version: nightly + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache Rust files + uses: actions/cache@v4 + with: + # target/ci isn't cached since it will be expected to change every day + path: | + ~/.cargo/ + # Save a unique cache each time + # (https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache) + key: rust-${{ matrix.rust_version }}-${{ github.run_id }} + # Load from the most recent match + restore-keys: | + rust-${{ matrix.rust_version }} + + - name: Rustup ${{ matrix.rust_version }} + run: | + rustup update ${{ matrix.rust_version }} + rustup override set ${{ matrix.rust_version }} + + - name: Build and test ${{ matrix.rust_version }} + env: + # Older clippy has some unwanted lints, ignore them. + NO_CLIPPY: ${{ matrix.no_clippy }} + run: ./ci/runtests.sh