Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Oct 17, 2023
1 parent f7d613c commit caac9c4
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Apply clippy lints
run: cargo hack clippy --each-feature
run: cargo hack clippy --each-feature --include-features sync,async --exclude-no-default-features

# Run tests on some extra platforms
cross:
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
path: ~/.cargo
key: ${{ runner.os }}-coverage-dotcargo
- name: Run build
run: cargo hack build --feature-powerset
run: cargo hack build --feature-powerset --include-features sync,async --exclude-no-default-features

test:
name: test
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
path: ~/.cargo
key: ${{ runner.os }}-coverage-dotcargo
- name: Run test
run: cargo hack test --feature-powerset
run: cargo hack test --feature-powerset --include-features sync,async --exclude-no-default-features

sanitizer:
name: sanitizer
Expand Down
2 changes: 1 addition & 1 deletion ci/miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ cargo miri setup

export MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-symbolic-alignment-check"

cargo hack miri test --each-feature
cargo hack miri test --each-feature --include-features sync,async --exclude-no-default-features

2 changes: 1 addition & 1 deletion ci/sanitizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cargo hack test --lib --each-feature

# Run thread sanitizer with cargo-hack
RUSTFLAGS="-Z sanitizer=thread" \
cargo hack -Zbuild-std test --lib --each-feature
cargo hack -Zbuild-std test --lib --each-feature --include-features sync,async --exclude-no-default-features
20 changes: 0 additions & 20 deletions ci/test-stable.sh

This file was deleted.

1 change: 1 addition & 0 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ macro_rules! impl_builder {
};
}

#[cfg(feature = "sync")]
macro_rules! impl_cache {
($cache: ident, $builder: ident, $item: ident) => {
use crate::store::UpdateResult;
Expand Down
2 changes: 1 addition & 1 deletion src/cache/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ where
/// This is a fine-tuning mechanism and you probably won't have to touch this.
#[inline]
pub fn set_buffer_size(mut self, sz: usize) -> Self {
self.insert_buffer_size = sz;
self.insert_buffer_size = sz;
self
}

Expand Down
3 changes: 3 additions & 0 deletions src/ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ use parking_lot::Mutex;

#[cfg(feature = "async")]
use crate::policy::AsyncLFUPolicy;
#[cfg(feature = "sync")]
use crate::policy::LFUPolicy;

#[cfg(feature = "sync")]
pub struct RingStripe<S> {
cons: Arc<LFUPolicy<S>>,
data: Mutex<Vec<u64>>,
capa: usize,
}

#[cfg(feature = "sync")]
impl<S> RingStripe<S>
where
S: BuildHasher + Clone + 'static,
Expand Down
4 changes: 2 additions & 2 deletions src/store.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::policy::LFUPolicy;
use crate::ttl::{ExpirationMap, Time};
use crate::utils::{change_lifetime_const, SharedValue, ValueRef, ValueRefMut};
use crate::{CacheError, DefaultUpdateValidator, Item as CrateItem, UpdateValidator};
Expand Down Expand Up @@ -238,9 +237,10 @@ impl<
.map(|val| val.expiration)
}

#[cfg(feature = "sync")]
pub fn try_cleanup<PS: BuildHasher + Clone + 'static>(
&self,
policy: Arc<LFUPolicy<PS>>,
policy: Arc<crate::policy::LFUPolicy<PS>>,
) -> Result<Vec<CrateItem<V>>, CacheError> {
let now = Time::now();
Ok(self
Expand Down

0 comments on commit caac9c4

Please sign in to comment.