From 8a53076dee221fc7c52520d8f0729b2d070c319f Mon Sep 17 00:00:00 2001 From: Arindam Das Date: Mon, 25 Sep 2023 16:20:23 +0530 Subject: [PATCH] chore: remove long running workflow; fix clippy errors --- .github/workflows/rust-bench.yml | 19 ------------------- .github/workflows/rust-ci.yml | 9 +++++++++ src/storage/commit_log/segmented_log/mod.rs | 4 ++-- 3 files changed, 11 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/rust-bench.yml diff --git a/.github/workflows/rust-bench.yml b/.github/workflows/rust-bench.yml deleted file mode 100644 index 843635687..000000000 --- a/.github/workflows/rust-bench.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: rust-bench -on: - pull_request: - branches: - - main - - develop - - 'dev/**' - paths: - - 'src/**' - - 'bench/**' - -jobs: - benchmark: - runs-on: self-hosted - steps: - - uses: actions/checkout@v3 - - uses: boa-dev/criterion-compare-action@v3 - with: - branchName: ${{ github.base_ref }} diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index ab3475d82..552ce767e 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -1,6 +1,15 @@ name: rust-ci on: workflow_dispatch: + + push: + branches: + - main + - develop + - 'dev/**' + paths: + - 'src/**' + pull_request: branches: - main diff --git a/src/storage/commit_log/segmented_log/mod.rs b/src/storage/commit_log/segmented_log/mod.rs index 354cbe96d..9bd0d3e52 100644 --- a/src/storage/commit_log/segmented_log/mod.rs +++ b/src/storage/commit_log/segmented_log/mod.rs @@ -403,7 +403,7 @@ where .as_mut() .ok_or(SegmentedLogError::CacheNotFound)?; - if cache.capacity() <= 0 { + if cache.capacity() == 0 { return Ok(()); } @@ -1335,7 +1335,7 @@ pub(crate) mod test { assert!(segmented_log .segments() - .nth(0) + .next() .unwrap() .cached_index_records() .is_some());