//! Helpers for quirks of the current tokio runtime. use std::future::Future; pub fn main(fut: F) -> T where F: Future + Send + 'static, T: std::fmt::Debug + Send + 'static, { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { let (tx, rx) = tokio::sync::oneshot::channel(); tokio::spawn(async move { tx.send(fut.await).unwrap() }); rx.await.unwrap() }) }