chore: clear compiler warnings

Remove accidental dead code (unused imports, the superseded paste tool()
helper, a never-read TORIENT handles field, a duplicate let binding, an
unneeded mut) and mark intentional-but-unwired scaffolding with
allow(dead_code): the web-only save_to_bytes, the plugin loadable() probe,
the planned PICK_HIGHLIGHT colours, the DynFieldSpec label, and the layout
ribbon helpers. Native build is now warning-clean apart from the upstream
nom/quick-xml future-incompat notices.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-18 21:18:09 +03:00
commit 5a36494ed7
11 changed files with 13 additions and 19 deletions

View file

@ -1204,7 +1204,7 @@ impl OpenCADStudio {
let cam_rot = self.tabs[i].scene.camera.borrow().rotation; let cam_rot = self.tabs[i].scene.camera.borrow().rotation;
let right = cam_rot * glam::Vec3::X; let right = cam_rot * glam::Vec3::X;
let view_twist = right.y.atan2(right.x) as f64; let view_twist = right.y.atan2(right.x) as f64;
let new_cmd = TorientCommand::new(handles, entities, view_twist); let new_cmd = TorientCommand::new(entities, view_twist);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }

View file

@ -47,7 +47,7 @@ impl OpenCADStudio {
/// sorted by name so the `HashMap` backing them renders stably). /// sorted by name so the `HashMap` backing them renders stably).
pub(super) fn style_names(&self, kind: StyleKind) -> Vec<String> { pub(super) fn style_names(&self, kind: StyleKind) -> Vec<String> {
let doc = &self.tabs[self.active_tab].scene.document; let doc = &self.tabs[self.active_tab].scene.document;
let mut from_objects = |pick: fn(&ObjectType) -> Option<&str>| -> Vec<String> { let from_objects = |pick: fn(&ObjectType) -> Option<&str>| -> Vec<String> {
let mut v: Vec<String> = doc let mut v: Vec<String> = doc
.objects .objects
.values() .values()

View file

@ -1677,7 +1677,6 @@ impl OpenCADStudio {
// buffer to the same submit path so typing a command name (or // buffer to the same submit path so typing a command name (or
// an option keyword like "R") and pressing Enter works without // an option keyword like "R") and pressing Enter works without
// first clicking into the command line (issue #99). // first clicking into the command line (issue #99).
let i = self.active_tab;
if !self.command_line.input.trim().is_empty() { if !self.command_line.input.trim().is_empty() {
return self.update(Message::CommandSubmit); return self.update(Message::CommandSubmit);
} }

View file

@ -379,6 +379,7 @@ pub enum DynAnchor {
pub struct DynFieldSpec { pub struct DynFieldSpec {
pub role: DynRole, pub role: DynRole,
/// Label override; `None` uses the role's default label. /// Label override; `None` uses the role's default label.
#[allow(dead_code)] // dyn-spec framework field; not yet consumed
pub label: Option<&'static str>, pub label: Option<&'static str>,
} }

View file

@ -361,6 +361,7 @@ pub fn save(doc: &CadDocument, path: &Path) -> Result<(), String> {
/// `doc.version`). Used by the web build, which hands the bytes to a browser /// `doc.version`). Used by the web build, which hands the bytes to a browser
/// download instead of writing a path — the byte-buffer counterpart to /// download instead of writing a path — the byte-buffer counterpart to
/// [`save_as_version`]. /// [`save_as_version`].
#[allow(dead_code)] // web/wasm build only; unused in the native target
pub fn save_to_bytes( pub fn save_to_bytes(
doc: &CadDocument, doc: &CadDocument,
ext: &str, ext: &str,

View file

@ -1,6 +1,6 @@
// Paste tool — ribbon definition + CadCommand implementation. // Paste tool — ribbon definition + CadCommand implementation.
use crate::modules::{IconKind, ModuleEvent, ToolDef}; use crate::modules::IconKind;
/// Shared icon for the Paste button and its dropdown entries. /// Shared icon for the Paste button and its dropdown entries.
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../../assets/icons/paste.svg")); pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../../assets/icons/paste.svg"));
@ -13,15 +13,6 @@ pub const MENU_ITEMS: &[(&str, &str, IconKind)] = &[
("PASTEBLOCK", "Paste as Block", ICON), ("PASTEBLOCK", "Paste as Block", ICON),
]; ];
pub fn tool() -> ToolDef {
ToolDef {
id: "PASTECLIP",
label: "Paste",
icon: ICON,
event: ModuleEvent::Command("PASTECLIP".to_string()),
}
}
// ── CadCommand implementation ───────────────────────────────────────────── // ── CadCommand implementation ─────────────────────────────────────────────
use acadrust::Handle; use acadrust::Handle;

View file

@ -9,7 +9,6 @@ use acadrust::Handle;
use glam::Vec3; use glam::Vec3;
use crate::command::{CadCommand, CmdResult, DynField}; use crate::command::{CadCommand, CmdResult, DynField};
use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
use acadrust::EntityType; use acadrust::EntityType;
@ -21,16 +20,14 @@ enum Step {
} }
pub struct TorientCommand { pub struct TorientCommand {
handles: Vec<Handle>,
entities: Vec<(Handle, EntityType)>, entities: Vec<(Handle, EntityType)>,
view_twist: f64, view_twist: f64,
step: Step, step: Step,
} }
impl TorientCommand { impl TorientCommand {
pub fn new(handles: Vec<Handle>, entities: Vec<(Handle, EntityType)>, view_twist: f64) -> Self { pub fn new(entities: Vec<(Handle, EntityType)>, view_twist: f64) -> Self {
Self { Self {
handles,
entities, entities,
view_twist, view_twist,
step: Step::AngleOrFirstPoint, step: Step::AngleOrFirstPoint,

View file

@ -47,6 +47,7 @@ impl ExternalPlugin {
/// True when the package can be loaded today: compatible API *and* a native /// True when the package can be loaded today: compatible API *and* a native
/// library present for this platform. /// library present for this platform.
#[allow(dead_code)] // plugin-host surface (issue #100); not yet wired
pub fn loadable(&self) -> bool { pub fn loadable(&self) -> bool {
self.api_compatible() && self.lib_present self.api_compatible() && self.lib_present
} }

View file

@ -79,8 +79,10 @@ impl WireModel {
pub const WHITE: [f32; 4] = [1.00, 1.00, 1.00, 1.0]; pub const WHITE: [f32; 4] = [1.00, 1.00, 1.00, 1.0];
pub const CYAN: [f32; 4] = [0.25, 0.85, 1.00, 1.0]; pub const CYAN: [f32; 4] = [0.25, 0.85, 1.00, 1.0];
pub const SELECTED: [f32; 4] = [0.15, 0.55, 1.00, 1.0]; pub const SELECTED: [f32; 4] = [0.15, 0.55, 1.00, 1.0];
/// Civil 3D-style object acquisition highlight (structure / catchment hover). /// Object-acquisition highlight (structure / catchment hover); not yet wired.
#[allow(dead_code)]
pub const PICK_HIGHLIGHT: [f32; 4] = [0.95, 0.50, 0.08, 1.0]; pub const PICK_HIGHLIGHT: [f32; 4] = [0.95, 0.50, 0.08, 1.0];
#[allow(dead_code)]
pub const PICK_HIGHLIGHT_DIM: [f32; 4] = [0.95, 0.50, 0.08, 0.45]; pub const PICK_HIGHLIGHT_DIM: [f32; 4] = [0.95, 0.50, 0.08, 0.45];
/// Sentinel AABB that never rejects any snap query. /// Sentinel AABB that never rejects any snap query.
pub const UNBOUNDED_AABB: [f32; 4] = [ pub const UNBOUNDED_AABB: [f32; 4] = [

View file

@ -407,7 +407,7 @@ impl<'a> Widget<Message, Theme, Renderer> for Floating<'a> {
&'b mut self, &'b mut self,
tree: &'b mut widget::Tree, tree: &'b mut widget::Tree,
layout: Layout<'b>, layout: Layout<'b>,
renderer: &Renderer, _renderer: &Renderer,
_viewport: &Rectangle, _viewport: &Rectangle,
translation: Vector, translation: Vector,
) -> Option<overlay::Element<'b, Message, Theme, Renderer>> { ) -> Option<overlay::Element<'b, Message, Theme, Renderer>> {

View file

@ -180,11 +180,13 @@ impl Ribbon {
} }
/// Returns the index of the Layout module in the modules list. /// Returns the index of the Layout module in the modules list.
#[allow(dead_code)] // layout-tab helpers; not yet wired
pub fn layout_module_index(&self) -> Option<usize> { pub fn layout_module_index(&self) -> Option<usize> {
self.modules.iter().position(|m| m.id() == "layout") self.modules.iter().position(|m| m.id() == "layout")
} }
/// Returns true if the currently active tab is the Layout module. /// Returns true if the currently active tab is the Layout module.
#[allow(dead_code)]
pub fn active_is_layout(&self) -> bool { pub fn active_is_layout(&self) -> bool {
self.modules self.modules
.get(self.active) .get(self.active)