@@ -43,10 +43,10 @@ impl<T> Sharded<T> {
43
43
44
44
/// The shard is selected by hashing `val` with `FxHasher`.
45
45
#[ inline]
46
- pub fn get_shard_by_value < K : Hash + ?Sized > ( & self , _val : & K ) -> & Lock < T > {
46
+ pub fn get_shard_by_value < K : Hash + ?Sized > ( & self , val : & K ) -> & Lock < T > {
47
47
match self {
48
48
Self :: Single ( single) => single,
49
- Self :: Shards ( ..) => self . get_shard_by_hash ( make_hash ( _val ) ) ,
49
+ Self :: Shards ( ..) => self . get_shard_by_hash ( make_hash ( val ) ) ,
50
50
}
51
51
}
52
52
@@ -56,20 +56,20 @@ impl<T> Sharded<T> {
56
56
}
57
57
58
58
#[ inline]
59
- pub fn get_shard_by_index ( & self , _i : usize ) -> & Lock < T > {
59
+ pub fn get_shard_by_index ( & self , i : usize ) -> & Lock < T > {
60
60
match self {
61
61
Self :: Single ( single) => single,
62
62
Self :: Shards ( shards) => {
63
63
// SAFETY: The index gets ANDed with the shard mask, ensuring it is always inbounds.
64
- unsafe { & shards. get_unchecked ( _i & ( SHARDS - 1 ) ) . 0 }
64
+ unsafe { & shards. get_unchecked ( i & ( SHARDS - 1 ) ) . 0 }
65
65
}
66
66
}
67
67
}
68
68
69
69
/// The shard is selected by hashing `val` with `FxHasher`.
70
70
#[ inline]
71
71
#[ track_caller]
72
- pub fn lock_shard_by_value < K : Hash + ?Sized > ( & self , _val : & K ) -> LockGuard < ' _ , T > {
72
+ pub fn lock_shard_by_value < K : Hash + ?Sized > ( & self , val : & K ) -> LockGuard < ' _ , T > {
73
73
match self {
74
74
Self :: Single ( single) => {
75
75
// Synchronization is disabled so use the `lock_assume_no_sync` method optimized
@@ -79,7 +79,7 @@ impl<T> Sharded<T> {
79
79
// `might_be_dyn_thread_safe` was also false.
80
80
unsafe { single. lock_assume ( Mode :: NoSync ) }
81
81
}
82
- Self :: Shards ( ..) => self . lock_shard_by_hash ( make_hash ( _val ) ) ,
82
+ Self :: Shards ( ..) => self . lock_shard_by_hash ( make_hash ( val ) ) ,
83
83
}
84
84
}
85
85
@@ -91,7 +91,7 @@ impl<T> Sharded<T> {
91
91
92
92
#[ inline]
93
93
#[ track_caller]
94
- pub fn lock_shard_by_index ( & self , _i : usize ) -> LockGuard < ' _ , T > {
94
+ pub fn lock_shard_by_index ( & self , i : usize ) -> LockGuard < ' _ , T > {
95
95
match self {
96
96
Self :: Single ( single) => {
97
97
// Synchronization is disabled so use the `lock_assume_no_sync` method optimized
@@ -109,7 +109,7 @@ impl<T> Sharded<T> {
109
109
// always inbounds.
110
110
// SAFETY (lock_assume_sync): We know `is_dyn_thread_safe` was true when creating
111
111
// the lock thus `might_be_dyn_thread_safe` was also true.
112
- unsafe { shards. get_unchecked ( _i & ( SHARDS - 1 ) ) . 0 . lock_assume ( Mode :: Sync ) }
112
+ unsafe { shards. get_unchecked ( i & ( SHARDS - 1 ) ) . 0 . lock_assume ( Mode :: Sync ) }
113
113
}
114
114
}
115
115
}
0 commit comments