From c024afcddd7361550000c1208c82f06e23d80f66 Mon Sep 17 00:00:00 2001 From: Mac L Date: Wed, 8 Oct 2025 00:54:06 +1100 Subject: [PATCH 1/2] Add clippy to CI --- .github/workflows/test-suite.yml | 11 ++++++++++- src/fixed_vector.rs | 2 +- src/variable_list.rs | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 5b973cb..38b0cf4 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -18,7 +18,16 @@ jobs: - name: Get latest version of stable Rust run: rustup update stable - name: Check formatting with cargo fmt - run: cargo fmt --all -- --check + run: cargo fmt --all --all-features -- --check + cargo-clippy: + name: cargo-clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get latest version of stable Rust + run: rustup update stable + - name: Check code quality with cargo clippy + run: cargo clippy --all --all-features -- --deny warnings test: strategy: matrix: diff --git a/src/fixed_vector.rs b/src/fixed_vector.rs index bc9b747..3fe9e71 100644 --- a/src/fixed_vector.rs +++ b/src/fixed_vector.rs @@ -378,7 +378,7 @@ impl<'a, T: arbitrary::Arbitrary<'a>, N: 'static + Unsigned> arbitrary::Arbitrar for _ in 0..size { vec.push(::arbitrary(u)?); } - Ok(Self::new(vec).map_err(|_| arbitrary::Error::IncorrectFormat)?) + Self::new(vec).map_err(|_| arbitrary::Error::IncorrectFormat) } } diff --git a/src/variable_list.rs b/src/variable_list.rs index 1b4cc37..f98ba8f 100644 --- a/src/variable_list.rs +++ b/src/variable_list.rs @@ -369,7 +369,7 @@ impl<'a, T: arbitrary::Arbitrary<'a>, N: 'static + Unsigned> arbitrary::Arbitrar for _ in 0..size { vec.push(::arbitrary(u)?); } - Ok(Self::new(vec).map_err(|_| arbitrary::Error::IncorrectFormat)?) + Self::new(vec).map_err(|_| arbitrary::Error::IncorrectFormat) } } From b3d60cdab9f03cc7cdb77e3025d81217d999f4f6 Mon Sep 17 00:00:00 2001 From: Mac L Date: Wed, 8 Oct 2025 16:08:41 +1100 Subject: [PATCH 2/2] Fix cargo-fmt --- .github/workflows/test-suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 38b0cf4..99184d4 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -18,7 +18,7 @@ jobs: - name: Get latest version of stable Rust run: rustup update stable - name: Check formatting with cargo fmt - run: cargo fmt --all --all-features -- --check + run: cargo fmt --all -- --check cargo-clippy: name: cargo-clippy runs-on: ubuntu-latest