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 29, 2023
1 parent 202691e commit c9a012e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
16 changes: 8 additions & 8 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 @@ -27,7 +28,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: ${{ matrix.rust.toolchain }}
override: true
components: rustfmt, clippy

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
6 changes: 2 additions & 4 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,13 +192,12 @@ 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));
let housekeeper = Housekeeper::new(Arc::downgrade(&inner), housekeeper_conf);
Self {
inner,
read_op_ch: r_snd,
write_op_ch: w_snd,
housekeeper: Some(housekeeper),
housekeeper: Some(Arc::new(housekeeper)),
}
}

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 c9a012e

Please sign in to comment.