chore: silence native and wasm build warnings

Gate target-specific code so neither build warns about the other's items:
native-only helpers (view, window icon, file dialogs, file association, plugin
host/guard/registry, self-update) are cfg'd to non-wasm; the wasm-only font
fallback (script_of / cjk_lang / request) is cfg'd to wasm. Drop an unused mut,
allow the few genuinely-conditional dead items (mesh_click_hit, GPU layout
helpers, parity stubs), and gate the embedded PlotSettings-unrelated dead
constants. Both targets now build clean (only the unavoidable nom/quick-xml
future-incompat dependency notice remains).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-22 02:03:34 +03:00
commit 10e4c18ba7
20 changed files with 37 additions and 2 deletions

View file

@ -106,6 +106,7 @@ pub struct HatchBatchedVertex {
}
impl HatchBatchedVertex {
#[allow(dead_code)]
pub fn layout<'a>() -> wgpu::VertexBufferLayout<'a> {
wgpu::VertexBufferLayout {
array_stride: std::mem::size_of::<HatchBatchedVertex>() as u64,
@ -450,6 +451,7 @@ impl HatchBatchedGpu {
/// constructed once at startup. All four bindings are read-only
/// storage and visible to both VS (AABB+visibility lookup) and FS
/// (boundary / family / dash sampling).
#[allow(dead_code)]
pub fn bind_group_layout(device: &wgpu::Device) -> wgpu::BindGroupLayout {
let entry = |binding: u32| wgpu::BindGroupLayoutEntry {
binding,

View file

@ -1001,7 +1001,7 @@ impl Pipeline {
// O(highlighted), no per-wire string parse. Selection recolours blue,
// hover orange. Drawn on top (depth-compare Always) over the base pass.
let mut out: Vec<WireModel> = Vec::new();
let mut push = |handle_val: u64, color: [f32; 4], wires: &[WireModel], out: &mut Vec<WireModel>| {
let push = |handle_val: u64, color: [f32; 4], wires: &[WireModel], out: &mut Vec<WireModel>| {
if let Some(idxs) = self.wire_handle_index.get(&handle_val) {
let mut slots = idxs.clone();
slots.sort_unstable();

View file

@ -24,6 +24,7 @@
use crate::scene::model::wire_model::WireModel;
use iced::wgpu;
#[cfg(not(target_arch = "wasm32"))]
use crate::par::prelude::*;
/// Allocate a VERTEX buffer with `mapped_at_creation` and write `data` directly