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 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-18 21:18:09 +03:00
1 parent 23844c137b
commit 5a36494ed7
11 files changed
+13 -19

No files matched your search

+1 -1
View File
@@ -1204,7 +1204,7 @@ impl OpenCADStudio {
let cam_rot = self.tabs[i].scene.camera.borrow().rotation;
let right = cam_rot * glam::Vec3::X;
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.tabs[i].active_cmd = Some(Box::new(new_cmd));
}
+1 -1
View File
@@ -47,7 +47,7 @@ impl OpenCADStudio {
/// sorted by name so the `HashMap` backing them renders stably).
pub(super) fn style_names(&self, kind: StyleKind) -> Vec<String> {
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
.objects
.values()
-1
View File
@@ -1677,7 +1677,6 @@ impl OpenCADStudio {
// buffer to the same submit path so typing a command name (or
// an option keyword like "R") and pressing Enter works without
// first clicking into the command line (issue #99).
let i = self.active_tab;
if !self.command_line.input.trim().is_empty() {
return self.update(Message::CommandSubmit);
}
+1
View File
@@ -379,6 +379,7 @@ pub enum DynAnchor {
pub struct DynFieldSpec {
pub role: DynRole,
/// Label override; `None` uses the role's default label.
#[allow(dead_code)] // dyn-spec framework field; not yet consumed
pub label: Option<&'static str>,
}
+1
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
/// download instead of writing a path — the byte-buffer counterpart to
/// [`save_as_version`].
#[allow(dead_code)] // web/wasm build only; unused in the native target
pub fn save_to_bytes(
doc: &CadDocument,
ext: &str,
+1 -10
View File
@@ -1,6 +1,6 @@
// 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.
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),
];
pub fn tool() -> ToolDef {
ToolDef {
id: "PASTECLIP",
label: "Paste",
icon: ICON,
event: ModuleEvent::Command("PASTECLIP".to_string()),
}
}
// ── CadCommand implementation ─────────────────────────────────────────────
use acadrust::Handle;
+1 -4
View File
@@ -9,7 +9,6 @@ use acadrust::Handle;
use glam::Vec3;
use crate::command::{CadCommand, CmdResult, DynField};
use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel;
use acadrust::EntityType;
@@ -21,16 +20,14 @@ enum Step {
}
pub struct TorientCommand {
handles: Vec<Handle>,
entities: Vec<(Handle, EntityType)>,
view_twist: f64,
step: Step,
}
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 {
handles,
entities,
view_twist,
step: Step::AngleOrFirstPoint,
+1
View File
@@ -47,6 +47,7 @@ impl ExternalPlugin {
/// True when the package can be loaded today: compatible API *and* a native
/// library present for this platform.
#[allow(dead_code)] // plugin-host surface (issue #100); not yet wired
pub fn loadable(&self) -> bool {
self.api_compatible() && self.lib_present
}
+3 -1
View File
@@ -79,8 +79,10 @@ impl WireModel {
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 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];
#[allow(dead_code)]
pub const PICK_HIGHLIGHT_DIM: [f32; 4] = [0.95, 0.50, 0.08, 0.45];
/// Sentinel AABB that never rejects any snap query.
pub const UNBOUNDED_AABB: [f32; 4] = [
+1 -1
View File
@@ -407,7 +407,7 @@ impl<'a> Widget<Message, Theme, Renderer> for Floating<'a> {
&'b mut self,
tree: &'b mut widget::Tree,
layout: Layout<'b>,
renderer: &Renderer,
_renderer: &Renderer,
_viewport: &Rectangle,
translation: Vector,
) -> Option<overlay::Element<'b, Message, Theme, Renderer>> {
+2
View File
@@ -180,11 +180,13 @@ impl Ribbon {
}
/// 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> {
self.modules.iter().position(|m| m.id() == "layout")
}
/// Returns true if the currently active tab is the Layout module.
#[allow(dead_code)]
pub fn active_is_layout(&self) -> bool {
self.modules
.get(self.active)