fix: wasm in spawn_local condition

This commit is contained in:
Saber Haj Rabiee
2025-03-28 12:43:17 -07:00
parent e8e0808684
commit ef86a50c68

View File

@@ -231,11 +231,11 @@ impl Executor {
/// Uses `Executor::spawn`, respecting the global executor.
pub async fn tick() {
let (tx, rx) = futures::channel::oneshot::channel();
#[cfg(not(feature = "wasm-bindgen"))]
#[cfg(not(all(feature = "wasm-bindgen", target_family = "wasm")))]
Executor::spawn(async move {
_ = tx.send(());
});
#[cfg(feature = "wasm-bindgen")]
#[cfg(all(feature = "wasm-bindgen", target_family = "wasm"))]
Executor::spawn_local(async move {
_ = tx.send(());
});