From 0ec56015e02087db297170aa7357642d41dfa9e4 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sun, 17 May 2026 19:34:56 +0300 Subject: [PATCH] chore(quadtree): silence dead-code warnings on planned API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `len` / `is_empty` / `remove` / `update` are exercised by unit tests and are part of the quadtree's public surface, but no production caller exists yet — Scene::add/erase/transform still trigger an epoch-based full rebuild rather than mutating the index in place. Annotating them with `#[allow(dead_code)]` keeps the API intact for the incremental-update follow-up without spamming the release build. Co-Authored-By: Claude Opus 4.7 --- src/scene/quadtree.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scene/quadtree.rs b/src/scene/quadtree.rs index a80b26fcc..f1fb49fbc 100644 --- a/src/scene/quadtree.rs +++ b/src/scene/quadtree.rs @@ -79,10 +79,19 @@ impl QuadTree { } } + // `len` / `is_empty` / `remove` / `update` are part of the public + // quadtree API and exercised by the unit tests, but production + // callers haven't landed yet (Scene::add/erase/transform paths + // still trigger an epoch-based full rebuild rather than mutating + // the index in place). The `#[allow(dead_code)]` is intentional — + // dropping them would shrink the public surface only to put it + // back once incremental updates ship. + #[allow(dead_code)] pub fn len(&self) -> usize { self.locator.len() + self.overflow.len() } + #[allow(dead_code)] pub fn is_empty(&self) -> bool { self.len() == 0 } @@ -112,6 +121,7 @@ impl QuadTree { } } + #[allow(dead_code)] pub fn remove(&mut self, handle: Handle) -> bool { if let Some((node_idx, item_idx)) = self.locator.remove(&handle) { let node = &mut self.nodes[node_idx as usize]; @@ -130,6 +140,7 @@ impl QuadTree { false } + #[allow(dead_code)] pub fn update(&mut self, handle: Handle, aabb: Aabb) { self.remove(handle); self.insert(handle, aabb);