use std::future::Future; use tokio::task::JoinHandle; #[cfg(tokio_unstable)] pub(crate) fn spawn(name: &str, future: F) -> std::io::Result> where F: Future + 'static, { tokio::task::Builder::new().name(name).spawn_local(future) } #[cfg(not(tokio_unstable))] pub(crate) fn spawn(name: &str, future: F) -> std::io::Result> where F: Future + 'static, { let _ = name; Ok(tokio::task::spawn_local(future)) }