From 4ede8824c06841fbf0907726f2eda3de7efacde6 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 4 Aug 2023 11:03:04 -0500 Subject: [PATCH 1/3] Add a CI workflow --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d95c023 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI +on: + pull_request: + push: + branches: + - master + +jobs: + check-msrv: + name: Check + strategy: + matrix: + toolchain: + - "1.65" + - stable + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain}} + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo check + run: cargo check + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo test + run: cargo test --workspace + + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo fmt + run: cargo fmt --all --check + + - name: Run cargo clippy + run: cargo clippy --workspace --all-targets -- -D warnings + + - name: Run cargo doc + run: cargo doc --no-deps --workspace --document-private-items + env: + RUSTDOCFLAGS: -D warnings From def0cb23cb5a61f2f68bac8c5df8acf735a89a3c Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 4 Aug 2023 11:33:45 -0500 Subject: [PATCH 2/3] Resolve clippy warnings --- matcher/src/fuzzy_optimal.rs | 1 + matcher/src/matrix.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/matcher/src/fuzzy_optimal.rs b/matcher/src/fuzzy_optimal.rs index 749fa0c..65fe95b 100644 --- a/matcher/src/fuzzy_optimal.rs +++ b/matcher/src/fuzzy_optimal.rs @@ -171,6 +171,7 @@ impl MatcherDataView<'_, H> { true } + #[allow(clippy::too_many_arguments)] fn score_row( current_row: &mut [ScoreCell], matrix_cells: &mut [MatrixCell], diff --git a/matcher/src/matrix.rs b/matcher/src/matrix.rs index e4ec0c6..eff3dae 100644 --- a/matcher/src/matrix.rs +++ b/matcher/src/matrix.rs @@ -60,6 +60,7 @@ impl MatrixLayout { /// # Safety /// /// `ptr` must point at an allocated with MARTIX_ALLOC_LAYOUT + #[allow(clippy::type_complexity)] unsafe fn fieds_from_ptr( &self, ptr: NonNull, From 00a5b24c212b0352ab17a8c6c237cd8f088a2613 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 4 Aug 2023 11:41:21 -0500 Subject: [PATCH 3/3] Fix 'cargo docs' warnings --- matcher/src/chars.rs | 2 +- src/boxcar.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matcher/src/chars.rs b/matcher/src/chars.rs index 4d61777..503cc9a 100644 --- a/matcher/src/chars.rs +++ b/matcher/src/chars.rs @@ -16,7 +16,7 @@ pub(crate) trait Char: Copy + Eq + Ord + fmt::Display { fn normalize(self, config: &MatcherConfig) -> Self; } -/// repr tansparent wrapper around u8 with better formatting and PartialEq implementation +/// repr tansparent wrapper around u8 with better formatting and `PartialEq` implementation #[repr(transparent)] #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] pub(crate) struct AsciiChar(pub u8); diff --git a/src/boxcar.rs b/src/boxcar.rs index 95e210f..67b1cb0 100644 --- a/src/boxcar.rs +++ b/src/boxcar.rs @@ -1,4 +1,4 @@ -//! Adapted from the `boxcar` crate at https://github.com/ibraheemdev/boxcar/blob/master/src/raw.rs +//! Adapted from the `boxcar` crate at //! under MIT licenes: //! //! Copyright (c) 2022 Ibraheem Ahmed