From 1cd5699702722d28e94fb1962a23fd191425b707 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 20 Jan 2025 01:35:11 +0900 Subject: [PATCH 1/2] ci: Use reusable workflows for fmt and security_audit --- .github/workflows/ci.yml | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e567c88..e7c6d7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,16 @@ defaults: shell: bash jobs: + fmt: + uses: smol-rs/.github/.github/workflows/fmt.yml@main + security_audit: + uses: smol-rs/.github/.github/workflows/security_audit.yml@main + permissions: + checks: write + contents: read + issues: write + secrets: inherit + test: runs-on: ${{ matrix.os }} strategy: @@ -77,14 +87,6 @@ jobs: run: rustup update stable - run: cargo clippy --all-features --all-targets - fmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable - - run: cargo fmt --all --check - miri: runs-on: ubuntu-latest steps: @@ -103,28 +105,12 @@ jobs: - name: Install Rust run: rustup update stable - name: Loom tests - run: cargo test --release --test loom --features loom + run: cargo test --release --test loom --features loom env: RUSTFLAGS: "--cfg=loom" LOOM_MAX_PREEMPTIONS: 4 - name: Loom tests without default features - run: cargo test --release --test loom --features loom --no-default-features + run: cargo test --release --test loom --features loom --no-default-features env: RUSTFLAGS: "--cfg=loom" LOOM_MAX_PREEMPTIONS: 4 - - security_audit: - permissions: - checks: write - contents: read - issues: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # rustsec/audit-check used to do this automatically - - name: Generate Cargo.lock - run: cargo generate-lockfile - # https://github.com/rustsec/audit-check/issues/2 - - uses: rustsec/audit-check@v2.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} From 2c547c434cc11d3b4f95b29504ecbb4736aea8ef Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 20 Jan 2025 01:36:22 +0900 Subject: [PATCH 2/2] Fix typo --- src/bounded.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bounded.rs b/src/bounded.rs index dab3a29..fe63dbf 100644 --- a/src/bounded.rs +++ b/src/bounded.rs @@ -231,7 +231,7 @@ impl Bounded { let slot = &self.buffer[index]; let stamp = slot.stamp.load(Ordering::Acquire); - // If the the stamp is ahead of the head by 1, we may attempt to pop. + // If the stamp is ahead of the head by 1, we may attempt to pop. if head + 1 == stamp { let new = if index + 1 < self.buffer.len() { // Same lap, incremented index.