Skip to content

Instantly share code, notes, and snippets.

@LucioFranco
Created February 7, 2019 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucioFranco/d1bbbc36140e3158cadbeab16013cdf3 to your computer and use it in GitHub Desktop.
Save LucioFranco/d1bbbc36140e3158cadbeab16013cdf3 to your computer and use it in GitHub Desktop.
use std::task::Future;
use futures::future::FutureExt;
pub fn spawn<F>(f: F)
where
F: Future + Send + 'static,
{
tokio::spawn(f.map(|_| ()).unit_error().boxed().compat());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment