Clear the remaining clippy warnings on the diff surface

This commit is contained in:
Dennis Kobert
2026-09-06 16:25:17 +00:00
parent a911bcc165
commit 9f0e0ebc96
21 changed files with 46 additions and 50 deletions

View File

@@ -196,7 +196,7 @@ impl Arena {
let count = COUNT.fetch_add(1, Ordering::Relaxed);
if reserved.is_none() {
eprintln!("arena> EXHAUSTED after {count} allocations, wanted {size} bytes\n{}", std::backtrace::Backtrace::force_capture());
} else if count % 20000 == 0 {
} else if count.is_multiple_of(20000) {
eprintln!("arena> {count} allocations, offset {}, this {size} bytes", self.offset.load(Ordering::Relaxed));
}
}

View File

@@ -176,7 +176,6 @@ mod tests {
let scope = frames.scope();
let mut claim = scope.claim(&layout);
addresses.push(claim.dst() as usize);
drop(claim);
drop(scope);
assert_eq!(frames.free_words(), free, "the scope returns its claims");
}

View File

@@ -33,7 +33,7 @@ impl FieldWrite {
unsafe { &*ptr.cast::<V>() }.cache_hash(&mut state);
}
unsafe fn content_eq<V: PartialEq>(a: *const u8, b: *const u8) -> bool {
unsafe { &*a.cast::<V>() == &*b.cast::<V>() }
unsafe { *a.cast::<V>() == *b.cast::<V>() }
}
Self {
name: A::NAME,
@@ -656,7 +656,7 @@ mod tests {
#[derive(Clone, dyn_any::DynAny)]
struct Opaque;
let hashed = (&ElementWritePick::<String>(std::marker::PhantomData)).element_write();
let hashed = ElementWritePick::<String>(std::marker::PhantomData).element_write();
assert!(hashed.content_hash.is_some() && hashed.content_eq.is_some());
let plain = (&ElementWritePick::<Opaque>(std::marker::PhantomData)).element_write();
assert!(plain.content_hash.is_none() && plain.content_eq.is_none());

View File

@@ -97,7 +97,7 @@ where
let Some(plan) = &self.plan else {
return self.edge.serve(input, slot);
};
match serve_input(&self.edge, input, &mut slot.frames().reborrow()) {
match serve_input(&self.edge, input, &slot.frames().reborrow()) {
GPoll::Final(value) => {
// SAFETY: the value came from this source, so it carries the
// plan's source layout.

View File

@@ -171,7 +171,7 @@ impl<'e> GroupItem<'e> {
// A run already living in the target region needs no copy: the arena is
// insert-only within a generation, so the lanes cannot move or change
// while the adopting item borrows them.
if batch.len() > 0 && arena.contains(batch.frames_ptr()) {
if !batch.is_empty() && arena.contains(batch.frames_ptr()) {
return Some(Self {
layout,
storage: ItemStorage::Resident(batch.frames_ptr()),

View File

@@ -553,9 +553,9 @@ mod run_tests {
let arena = core_types::arena::Arena::new(1 << 16).unwrap();
let mut builder = RunBuilder::new(&arena, element_write_hashed::<Vector>(), &[FieldWrite::of::<core_types::attribute::Transform>(0)], 2).unwrap();
for lane in 0..2 {
let lane = builder.push(vectors[lane].clone()).unwrap();
builder.attr::<core_types::attribute::Transform>(lane, transforms[lane]);
for (vector, transform) in vectors.iter().zip(transforms) {
let lane = builder.push(vector.clone()).unwrap();
builder.attr::<core_types::attribute::Transform>(lane, transform);
}
let item = builder.finish();
let run = RunView::<Vector>::new(&item).expect("the run holds vector elements");