fix: gate host_fetch and host_notify on wasmtime-runtime feature; suppress dead_code on resolve_weft_system_url

This commit is contained in:
Marco Allegretti 2026-03-12 12:52:55 +01:00
parent 4d0089a107
commit 91eb7cb823
2 changed files with 4 additions and 2 deletions

View file

@ -340,6 +340,7 @@ fn load_ui_kit_script() -> Option<String> {
std::fs::read_to_string(ui_kit_path()).ok()
}
#[allow(dead_code)]
fn resolve_weft_system_url(url: &ServoUrl) -> Option<ServoUrl> {
if url.scheme() != "weft-system" { return None; }
let host = url.host_str().unwrap_or("");

View file

@ -309,7 +309,7 @@ fn run_module(
.map_err(|()| anyhow::anyhow!("wasm component run exited with error"))
}
#[cfg(feature = "net-fetch")]
#[cfg(all(feature = "wasmtime-runtime", feature = "net-fetch"))]
fn host_fetch(
url: &str,
method: &str,
@ -336,7 +336,7 @@ fn host_fetch(
Ok((status, content_type, body_bytes))
}
#[cfg(not(feature = "net-fetch"))]
#[cfg(all(feature = "wasmtime-runtime", not(feature = "net-fetch")))]
fn host_fetch(
_url: &str,
_method: &str,
@ -346,6 +346,7 @@ fn host_fetch(
Err("net-fetch capability not compiled in".to_owned())
}
#[cfg(feature = "wasmtime-runtime")]
fn host_notify(title: &str, body: &str, icon: Option<&str>) -> Result<(), String> {
let mut cmd = std::process::Command::new("notify-send");
if let Some(i) = icon {