Skip to content

Commit 2a82b61

Browse files
authored
Fix all warnings from the latest Clippy (#1123)
1 parent 407375c commit 2a82b61

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
6969
] }
7070
unreachable_pub = "warn"
7171
# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV
72+
73+
[workspace.lints.clippy]
74+
# Suppress buggy or noisy clippy lints
75+
declare_interior_mutable_const = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665

crossbeam-channel/src/select_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ macro_rules! crossbeam_channel_internal {
687687
const _LEN: usize = $crate::crossbeam_channel_internal!(@count ($($cases)*));
688688
let _handle: &dyn $crate::internal::SelectHandle = &$crate::never::<()>();
689689

690-
#[allow(unused_mut)]
690+
#[allow(unused_mut, clippy::zero_repeat_side_effects)]
691691
let mut _sel = [(_handle, 0, ::std::ptr::null()); _LEN];
692692

693693
$crate::crossbeam_channel_internal!(

crossbeam-skiplist/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
//! A solution to the above is to have the implementation wrap
9292
//! each value in a lock. However, this has some repercussions:
9393
//! * The map would no longer be lock-free, inhibiting scalability
94-
//! and allowing for deadlocks.
94+
//! and allowing for deadlocks.
9595
//! * If a user of the map doesn't need mutable access, then they pay
96-
//! the price of locks without actually needing them.
96+
//! the price of locks without actually needing them.
9797
//!
9898
//! Instead, the approach taken by this crate gives more control to the user.
9999
//! If mutable access is needed, then you can use interior mutability,
@@ -150,7 +150,7 @@
150150
//! Crossbeam [does not currently provide a concurrent unordered map](https://github.com/crossbeam-rs/rfcs/issues/32).
151151
//! That said, here are some other crates which may suit you:
152152
//! * [`DashMap`](https://docs.rs/dashmap) implements a novel concurrent hash map
153-
//! with good performance characteristics.
153+
//! with good performance characteristics.
154154
//! * [`flurry`](https://docs.rs/flurry) is a Rust port of Java's `ConcurrentHashMap`.
155155
//!
156156
//! [`insert`]: SkipMap::insert

crossbeam-utils/src/atomic/atomic_cell.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,6 @@ fn lock(addr: usize) -> &'static SeqLock {
972972
// stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3.
973973
// In order to protect from such cases, we simply choose a large prime number for `LEN`.
974974
const LEN: usize = 67;
975-
#[allow(clippy::declare_interior_mutable_const)]
976975
const L: CachePadded<SeqLock> = CachePadded::new(SeqLock::new());
977976
static LOCKS: [CachePadded<SeqLock>; LEN] = [L; LEN];
978977

0 commit comments

Comments
 (0)