diff --git a/web-async/src/lock.rs b/web-async/src/lock.rs index 85db989..02fa6c4 100644 --- a/web-async/src/lock.rs +++ b/web-async/src/lock.rs @@ -54,6 +54,12 @@ impl Clone for Lock { } } +impl fmt::Debug for Lock { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.inner.fmt(f) + } +} + pub struct LockGuard<'a, T> { #[cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))] inner: parking_lot::MutexGuard<'a, T>, diff --git a/web-async/src/spawn.rs b/web-async/src/spawn.rs index cef6b26..9b66aec 100644 --- a/web-async/src/spawn.rs +++ b/web-async/src/spawn.rs @@ -13,14 +13,6 @@ pub fn spawn + Send + 'static>(f: F) { tokio::task::spawn(f); } -#[cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))] -#[track_caller] -pub fn spawn_named + Send + 'static>(name: &str, f: F) { - #[cfg(feature = "tracing")] - let f = tracing::Instrument::in_current_span(f); - tokio::task::Builder::new().name(name).spawn(f).ok(); -} - #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] #[track_caller] pub fn spawn + 'static>(f: F) { @@ -28,13 +20,3 @@ pub fn spawn + 'static>(f: F) { let f = tracing::Instrument::in_current_span(f); wasm_bindgen_futures::spawn_local(f); } - -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] -#[track_caller] -pub fn spawn_named + 'static>(name: &str, f: F) { - // WASM doesn't support task names, just spawn normally - #[cfg(feature = "tracing")] - let f = tracing::Instrument::in_current_span(f); - let _ = name; // Suppress unused warning - wasm_bindgen_futures::spawn_local(f); -}