Skip to content

Instantly share code, notes, and snippets.

@jlindsey
Created August 23, 2017 19:33
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 jlindsey/5f8a2c3573a0cb2606191dfe050dc4a9 to your computer and use it in GitHub Desktop.
Save jlindsey/5f8a2c3573a0cb2606191dfe050dc4a9 to your computer and use it in GitHub Desktop.
trait BoxedFn {
fn call_box(self: Box<Self>);
}
impl<F: FnOnce()> BoxedFn for F {
fn call_box(self: Box<F>) {
(*self)()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment