Skip to content

Commit 4d66e84

Browse files
committed
Fix beta Clippy warnings
clippy 0.1.83 (88c1c3c1102 2024-10-18)
1 parent 732ff1f commit 4d66e84

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

src/common/deque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<T> Drop for Deque<T> {
7070
fn drop(&mut self) {
7171
struct DropGuard<'a, T>(&'a mut Deque<T>);
7272

73-
impl<'a, T> Drop for DropGuard<'a, T> {
73+
impl<T> Drop for DropGuard<'_, T> {
7474
fn drop(&mut self) {
7575
// Continue the same loop we do below. This only runs when a destructor has
7676
// panicked. If another one panics this will abort.

src/sync/base_cache.rs

+8
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ where
219219
}
220220
}
221221

222+
// Clippy beta 0.1.83 (f41c7ed9889 2024-10-31) warns about unused lifetimes on 'a.
223+
// This seems a false positive. The lifetimes are used in the trait bounds.
224+
// https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
225+
#[allow(clippy::extra_unused_lifetimes)]
222226
impl<'a, K, V, S> BaseCache<K, V, S>
223227
where
224228
K: 'a + Eq + Hash,
@@ -620,6 +624,10 @@ impl<K, V, S> Inner<K, V, S> {
620624
}
621625
}
622626

627+
// Clippy beta 0.1.83 (f41c7ed9889 2024-10-31) warns about unused lifetimes on 'a.
628+
// This seems a false positive. The lifetimes are used in the trait bounds.
629+
// https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
630+
#[allow(clippy::extra_unused_lifetimes)]
623631
impl<'a, K, V, S> Inner<K, V, S>
624632
where
625633
K: 'a + Eq + Hash,

src/sync/cache.rs

+4
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,10 @@ where
493493
}
494494
}
495495

496+
// Clippy beta 0.1.83 (f41c7ed9889 2024-10-31) warns about unused lifetimes on 'a.
497+
// This seems a false positive. The lifetimes are used in the trait bounds.
498+
// https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
499+
#[allow(clippy::extra_unused_lifetimes)]
496500
impl<'a, K, V, S> Cache<K, V, S>
497501
where
498502
K: 'a + Eq + Hash,

src/sync/iter.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,22 @@ where
3939
}
4040
}
4141

42-
unsafe impl<'a, 'i, K, V, S> Send for Iter<'i, K, V, S>
42+
// Clippy beta 0.1.83 (f41c7ed9889 2024-10-31) warns about unused lifetimes on 'a.
43+
// This seems a false positive. The lifetimes are used in the trait bounds.
44+
// https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
45+
#[allow(clippy::extra_unused_lifetimes)]
46+
unsafe impl<'a, K, V, S> Send for Iter<'_, K, V, S>
4347
where
4448
K: 'a + Eq + Hash + Send,
4549
V: 'a + Send,
4650
S: 'a + BuildHasher + Clone,
4751
{
4852
}
4953

50-
unsafe impl<'a, 'i, K, V, S> Sync for Iter<'i, K, V, S>
54+
// Clippy beta 0.1.83 (f41c7ed9889 2024-10-31) warns about unused lifetimes on 'a.
55+
// This seems a false positive. The lifetimes are used in the trait bounds.
56+
// https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
57+
#[allow(clippy::extra_unused_lifetimes)]unsafe impl<'a, K, V, S> Sync for Iter<'_, K, V, S>
5158
where
5259
K: 'a + Eq + Hash + Sync,
5360
V: 'a + Sync,

src/sync/mapref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type DashMapRef<'a, K, V> =
88

99
pub struct EntryRef<'a, K, V>(DashMapRef<'a, K, V>);
1010

11-
unsafe impl<'a, K, V> Sync for EntryRef<'a, K, V>
11+
unsafe impl<K, V> Sync for EntryRef<'_, K, V>
1212
where
1313
K: Eq + Hash + Send + Sync,
1414
V: Send + Sync,
@@ -36,7 +36,7 @@ where
3636
}
3737
}
3838

39-
impl<'a, K, V> std::ops::Deref for EntryRef<'a, K, V>
39+
impl<K, V> std::ops::Deref for EntryRef<'_, K, V>
4040
where
4141
K: Eq + Hash,
4242
{

src/unsync/cache.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ where
427427
/// Like the `invalidate` method, this method does not clear the historic
428428
/// popularity estimator of keys so that it retains the client activities of
429429
/// trying to retrieve an item.
430-
430+
// -----------------------------------------------------------------------
431+
// (The followings are not doc comments)
431432
// We need this #[allow(...)] to avoid a false Clippy warning about needless
432433
// collect to create keys_to_invalidate.
433434
// clippy 0.1.52 (9a1dfd2dc5c 2021-04-30) in Rust 1.52.0-beta.7

0 commit comments

Comments
 (0)