Skip to content

Commit c7edf1f

Browse files
powergeetaiki-e
authored andcommitted
Fix all warnings from the latest Clippy (#1123)
1 parent 3f5d51f commit c7edf1f

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
@@ -71,3 +71,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
7171
'cfg(crossbeam_loom)',
7272
'cfg(crossbeam_sanitize)',
7373
] }
74+
75+
[workspace.lints.clippy]
76+
# Suppress buggy or noisy clippy lints
77+
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
@@ -1000,7 +1000,6 @@ fn lock(addr: usize) -> &'static SeqLock {
10001000
// stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3.
10011001
// In order to protect from such cases, we simply choose a large prime number for `LEN`.
10021002
const LEN: usize = 67;
1003-
#[allow(clippy::declare_interior_mutable_const)]
10041003
const L: CachePadded<SeqLock> = CachePadded::new(SeqLock::new());
10051004
static LOCKS: [CachePadded<SeqLock>; LEN] = [L; LEN];
10061005

0 commit comments

Comments
 (0)