Skip to content

Commit

Permalink
Fix Clippy warnings
Browse files Browse the repository at this point in the history
clippy 0.1.72 (a47f796a365 2023-07-22)
  • Loading branch information
tatsuya6502 committed Jul 28, 2023
1 parent 202691e commit f6ef126
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/Lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
strategy:
matrix:
rust:
- stable
- beta
- toolchain: stable
- toolchain: beta
rustflags: '--cfg beta_clippy'

steps:
- name: Checkout Moka
Expand All @@ -40,16 +41,15 @@ jobs:

- name: Run Clippy
uses: actions-rs/clippy-check@v1
if: ${{ matrix.rust == 'stable' || matrix.rust == 'beta' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Specify individual features until we remove `dash` feature.
# args: --lib --tests --all-features --all-targets -- -D warnings
args: --lib --tests --features 'future, logging, unstable-debug-counters' --all-targets -- -D warnings
args: --lib --tests --all-features --all-targets -- -D warnings
env:
RUSTFLAGS: ${{ matrix.rust.rustflags }}

- name: Run Rustfmt
uses: actions-rs/cargo@v1
if: ${{ matrix.rust == 'stable' }}
if: ${{ matrix.rust.toolchain == 'stable' }}
with:
command: fmt
args: --all -- --check
2 changes: 1 addition & 1 deletion src/notification/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl<K, V> ThreadPoolRemovalNotifier<K, V> {
is_shutting_down: Default::default(),
};

#[allow(clippy::arc_with_non_send_sync)]
#[cfg_attr(beta_clippy, allow(clippy::arc_with_non_send_sync))]
let state = Arc::new(state);

Self {
Expand Down
2 changes: 0 additions & 2 deletions src/sync_base/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ where
let (r_snd, r_rcv) = crossbeam_channel::bounded(r_size);
let (w_snd, w_rcv) = crossbeam_channel::bounded(w_size);

#[allow(clippy::arc_with_non_send_sync)]
let inner = Arc::new(Inner::new(
name,
max_capacity,
Expand All @@ -193,7 +192,6 @@ where
if invalidator_enabled {
inner.set_invalidator(&inner);
}
#[allow(clippy::arc_with_non_send_sync)]
let housekeeper = Arc::new(Housekeeper::new(Arc::downgrade(&inner), housekeeper_conf));
Self {
inner,
Expand Down
2 changes: 1 addition & 1 deletion src/sync_base/invalidator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<K, V, S> Invalidator<K, V, S> {
Self {
predicates: RwLock::new(HashMap::new()),
is_empty: AtomicBool::new(true),
#[allow(clippy::arc_with_non_send_sync)]
#[cfg_attr(beta_clippy, allow(clippy::arc_with_non_send_sync))]
scan_context: Arc::new(ScanContext::new(cache)),
thread_pool,
}
Expand Down

0 comments on commit f6ef126

Please sign in to comment.