Skip to content

Instantly share code, notes, and snippets.

@DoumanAsh
Created April 17, 2019 19:27
Show Gist options
  • Save DoumanAsh/806b9928719ff6b94c170383c4b825bf to your computer and use it in GitHub Desktop.
Save DoumanAsh/806b9928719ff6b94c170383c4b825bf to your computer and use it in GitHub Desktop.
impl<F: Send + 'static + Future<Item=I, Error=E>, I: Send + 'static, E: Send + 'static> AutoRuntime for F {
#[inline]
fn finish(self) -> Result<Self::Item, Self::Error> {
block_on(self)
}
#[inline]
fn spawn(self) where Self: 'static + Future<Item=(), Error=()> + Send {
spawn(self);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment