Fix/allow remaining clippy lints

This commit is contained in:
Erik Grinaker
2025-06-30 12:36:20 +02:00
parent 67b04f8ab3
commit a5b0fc560c
5 changed files with 8 additions and 1 deletions

View File

@@ -321,6 +321,7 @@ where
*item = core::INVALID_POS;
}
#[allow(clippy::needless_range_loop)]
for i in 0..old_num_buckets as usize {
if buckets[i].inner.is_none() {
continue;

View File

@@ -115,6 +115,7 @@ where
// Error means you must retry.
//
// This corresponds to the 'lookupOpt' function in the paper
#[allow(clippy::only_used_in_recursion)]
fn lookup_recurse<'e, V: Value>(
key: &[u8],
node: NodeRef<'e, V>,
@@ -155,6 +156,7 @@ fn lookup_recurse<'e, V: Value>(
}
}
#[allow(clippy::only_used_in_recursion)]
fn next_recurse<'e, V: Value>(
min_key: &[u8],
path: &mut Vec<u8>,
@@ -213,6 +215,7 @@ fn next_recurse<'e, V: Value>(
}
// This corresponds to the 'insertOpt' function in the paper
#[allow(clippy::only_used_in_recursion)]
#[allow(clippy::too_many_arguments)]
pub(crate) fn update_recurse<'e, K: Key, V: Value, A: ArtAllocator<V>, F>(
key: &[u8],
@@ -369,6 +372,7 @@ pub(crate) fn dump_tree<V: Value + std::fmt::Debug>(
}
// TODO: return an Err if writeln!() returns error, instead of unwrapping
#[allow(clippy::only_used_in_recursion)]
fn dump_recurse<'e, V: Value + std::fmt::Debug>(
path: &[PathElement],
node: NodeRef<'e, V>,

View File

@@ -45,6 +45,7 @@ impl<V> std::fmt::Debug for NodePtr<V> {
impl<V> Copy for NodePtr<V> {}
impl<V> Clone for NodePtr<V> {
#[allow(clippy::non_canonical_clone_impl)]
fn clone(&self) -> NodePtr<V> {
NodePtr {
ptr: self.ptr,

View File

@@ -370,6 +370,7 @@ mod tests {
for i in 0..11 {
all.push(slab.alloc(i));
}
#[allow(clippy::needless_range_loop)]
for i in 0..11 {
assert!(unsafe { (*all[i]).val == i });
}

View File

@@ -323,7 +323,7 @@ impl<'t> CommunicatorWorkerProcessStruct<'t> {
self.request_prefetchv_counter.inc();
self.request_prefetchv_nblocks_counter
.inc_by(req.nblocks as u64);
let req = req.clone();
let req = *req;
tokio::spawn(async move { self.handle_prefetchv_request(&req).await });
NeonIOResult::PrefetchVLaunched
}