mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 01:54:29 +01:00
Fix the remaining Rust 1.99 clippy findings
Use slice fill in the particles test (manual_slice_fill) and AtomicUsize::try_update, the renamed fetch_update, in the connection limiter. Both are behaviour-neutral. Refs #233 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
715baf4760
commit
bc563f504a
2 files changed
+2
-4
No files matched your search
@@ -179,7 +179,7 @@ pub struct Permit(Arc<AtomicUsize>);
|
||||
|
||||
impl ConnectionLimiter {
|
||||
pub fn try_acquire(&self, max: usize) -> Option<Permit> {
|
||||
self.0.fetch_update(Ordering::AcqRel, Ordering::Acquire, |n| (n < max).then_some(n + 1)).ok().map(|_| Permit(self.0.clone()))
|
||||
self.0.try_update(Ordering::AcqRel, Ordering::Acquire, |n| (n < max).then_some(n + 1)).ok().map(|_| Permit(self.0.clone()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,9 +83,7 @@ mod tests {
|
||||
for p in &mut m.positions {
|
||||
*p = Vec3::new(p.x, -p.z, 0.0);
|
||||
}
|
||||
for n in &mut m.normals {
|
||||
*n = Vec3::Z;
|
||||
}
|
||||
m.normals.fill(Vec3::Z);
|
||||
let bvh = Bvh::new(&m);
|
||||
let cam = OrbitCamera::default();
|
||||
let ctx = PickCtx { mesh: &m, bvh: &bvh, camera: &cam, viewport: Vec2::new(100.0, 100.0) };
|
||||
|
||||
Reference in new issue
Block a user