Lint: clippy -D warnings passes for the wasm32 web build
On main, cargo xtask wasm printed two dead-code warnings in
vectorcraft-ui-egui, and this clippy run reported the same two as
errors:
cargo clippy --target wasm32-unknown-unknown -p vectorcraft-web -- -D warnings
ask_update_changed (dialogs/missing_links.rs) is called only from
tick_link_updates, and is_c_locale (i18n/mod.rs) is called only from
detect_system_lang. Both callers are compiled only for native targets.
Each function now has the same #[cfg(not(target_arch = "wasm32"))]
attribute as its caller. Native builds compile both functions as
before.
This commit is contained in:
parent
3bd04a082e
commit
d79aa607cc
|
|
@ -66,6 +66,7 @@ fn ask_update(app: &mut VectorcraftApp, ids: Vec<Value>) {
|
|||
|
||||
/// The same offer for linked files another app changed while the document is open
|
||||
/// ([`vectorcraft_engine::link_watch`]).
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(crate) fn ask_update_changed(app: &mut VectorcraftApp, ids: Vec<Value>) {
|
||||
ask(app, ids, tl!("{count} linked image(s) changed on disk. Show the new versions?"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@ pub fn lang_from_tag(tag: &str) -> Option<Lang> {
|
|||
|
||||
/// True when `tag` names the generic `C` / `POSIX` locale (or a variant like `C.UTF-8`), which on
|
||||
/// macOS means "no particular language" rather than English: the system language list decides.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn is_c_locale(tag: &str) -> bool {
|
||||
let base = tag.split(['.', '@']).next().unwrap_or("").to_ascii_lowercase();
|
||||
matches!(base.as_str(), "c" | "posix")
|
||||
|
|
|
|||
Loading…
Reference in New Issue