From 961af30997b43f76ff02cfe0b5dac24c59366cc0 Mon Sep 17 00:00:00 2001 From: Alexander Krylov Date: Sun, 25 Oct 2026 04:34:05 +0300 Subject: [PATCH 1/2] Clippy: clear the two warnings that the whole tree fails on The update tests' scratch helper only feeds unix-gated tests, and receive_decorated takes the box the queue already put the protos in. --- crates/horizon-client/src/streaming.rs | 4 ++++ crates/horizon-server/src/update.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crates/horizon-client/src/streaming.rs b/crates/horizon-client/src/streaming.rs index 4cad224fd..17af59746 100644 --- a/crates/horizon-client/src/streaming.rs +++ b/crates/horizon-client/src/streaming.rs @@ -637,6 +637,10 @@ impl Streaming { }); self.shared.ready.notify_one(); } + #[expect( + clippy::boxed_local, + reason = "the box is `Done::Decorated`'s, so moving it out copies nothing" + )] fn receive_decorated(&mut self, x: i32, z: i32, region: Box<[Proto; 9]>) { self.generation_scan.exhausted = false; self.decorating -= 1; diff --git a/crates/horizon-server/src/update.rs b/crates/horizon-server/src/update.rs index 8c87c66bc..0f3f57080 100644 --- a/crates/horizon-server/src/update.rs +++ b/crates/horizon-server/src/update.rs @@ -781,6 +781,8 @@ mod tests { use super::*; use serde_json::json; + // Only the unix tests build an install tree; the path helper goes with them. + #[cfg_attr(not(unix), allow(dead_code))] fn scratch(name: &str) -> PathBuf { let dir = std::env::temp_dir().join(format!( "horizon-server-update-{name}-{}", From fb1f421117bdf5425fbe9ddf3162e67b39ed5139 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 09:32:55 +0100 Subject: [PATCH 2/2] Clippy: take the decorated region by value, and gate the unix-only test helper receive_decorated moved the nine protos out of the box anyway (the array iterator holds them inline), so taking [Proto; 9] and unboxing at the three call sites costs the same and leaves boxed_local nothing to flag on any target. The #[expect] failed on Linux, where the lint does not fire, which is why verify was red. scratch is only called from the #[cfg(unix)] tests, so it carries the same cfg as installed() next to it. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/streaming.rs | 12 ++++-------- crates/horizon-server/src/update.rs | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/crates/horizon-client/src/streaming.rs b/crates/horizon-client/src/streaming.rs index 17af59746..e0f0586e4 100644 --- a/crates/horizon-client/src/streaming.rs +++ b/crates/horizon-client/src/streaming.rs @@ -637,11 +637,7 @@ impl Streaming { }); self.shared.ready.notify_one(); } - #[expect( - clippy::boxed_local, - reason = "the box is `Done::Decorated`'s, so moving it out copies nothing" - )] - fn receive_decorated(&mut self, x: i32, z: i32, region: Box<[Proto; 9]>) { + fn receive_decorated(&mut self, x: i32, z: i32, region: [Proto; 9]) { self.generation_scan.exhausted = false; self.decorating -= 1; self.decorated.insert((x, z)); @@ -828,7 +824,7 @@ impl Streaming { } } } - Done::Decorated(x, z, region) => self.receive_decorated(x, z, region), + Done::Decorated(x, z, region) => self.receive_decorated(x, z, *region), Done::Generated(chunk) => self.receive_generated(chunk, world), Done::Saved(protos) => self.receive_saved(protos), Done::Lit(x, z, sections, seq) => { @@ -1310,7 +1306,7 @@ impl Streaming { while self.decorating > 0 || !self.finishing.is_empty() || self.saving > 0 { let left = deadline.saturating_duration_since(std::time::Instant::now()); match self.results.recv_timeout(left) { - Ok(Done::Decorated(x, z, region)) => self.receive_decorated(x, z, region), + Ok(Done::Decorated(x, z, region)) => self.receive_decorated(x, z, *region), Ok(Done::Generated(chunk)) => self.receive_generated(chunk, world), Ok(Done::Saved(protos)) => self.receive_saved(protos), Ok(other) => self.deferred.push(other), @@ -1338,7 +1334,7 @@ impl Streaming { let started = std::time::Instant::now(); while let Ok(done) = self.results.try_recv() { match done { - Done::Decorated(x, z, region) => self.receive_decorated(x, z, region), + Done::Decorated(x, z, region) => self.receive_decorated(x, z, *region), Done::Generated(chunk) => self.receive_generated(chunk, world), Done::Saved(protos) => self.receive_saved(protos), other => self.deferred.push(other), diff --git a/crates/horizon-server/src/update.rs b/crates/horizon-server/src/update.rs index 0f3f57080..06b498af9 100644 --- a/crates/horizon-server/src/update.rs +++ b/crates/horizon-server/src/update.rs @@ -781,8 +781,7 @@ mod tests { use super::*; use serde_json::json; - // Only the unix tests build an install tree; the path helper goes with them. - #[cfg_attr(not(unix), allow(dead_code))] + #[cfg(unix)] fn scratch(name: &str) -> PathBuf { let dir = std::env::temp_dir().join(format!( "horizon-server-update-{name}-{}",