ui-egui: cfg opening_generation off wasm32; lint the wasm set with -D warnings (#1954)

This commit is contained in:
Naseq committed 2026-11-08 09:07:05 +04:30
1 parent fc35ad67c6
commit 283a148420
3 files changed
+8 -4

No files matched your search

+1
View File
@@ -72,6 +72,7 @@ impl SlideApp {
synthetic_injected_time: None,
ribbon_scroll: HashMap::new(),
show_instance: 0,
#[cfg(not(target_arch = "wasm32"))]
opening_generation: 0,
canvas_rect: None,
eyedropper: None,
+2 -1
View File
@@ -276,7 +276,8 @@ pub struct SlideApp {
ribbon_scroll: HashMap<String, u32>,
/// Monotonic identity for a new slide show instance (`start_show`).
show_instance: u64,
/// Monotonic identity for a new background-open attempt.
/// Monotonic identity for a new background-open attempt (the web build has no threads).
#[cfg(not(target_arch = "wasm32"))]
opening_generation: u64,
/// Canvas screen rect and points-per-slide-point scale (for control & tests).
pub canvas_rect: Option<egui::Rect>,
+5 -3
View File
@@ -147,13 +147,15 @@ fn cmd_wasm() -> Result<(), String> {
if set.is_empty() {
return Err("no wasm-safe crates found in the workspace metadata".into());
}
// Clippy with `-D warnings`, as the host step: a plain `check` let wasm-only dead code through (#1954).
let mut c = cargo();
c.args(["check", "--target", "wasm32-unknown-unknown", "--keep-going"]);
c.args(["clippy", "--target", "wasm32-unknown-unknown", "--keep-going"]);
for pkg in &set {
c.args(["-p", pkg]);
}
run(c, &format!("cargo check --target wasm32-unknown-unknown --keep-going -p {}", set.join(" -p ")))?;
println!("\nwasm32-unknown-unknown check: ok ({} crates: {})", set.len(), set.join(", "));
c.args(["--", "-D", "warnings"]);
run(c, &format!("cargo clippy --target wasm32-unknown-unknown --keep-going -p {} -- -D warnings", set.join(" -p ")))?;
println!("\nwasm32-unknown-unknown clippy: ok ({} crates: {})", set.len(), set.join(", "));
Ok(())
}