Skip to content

Instantly share code, notes, and snippets.

@eevee
Created October 12, 2012 03:38
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 eevee/3877152 to your computer and use it in GitHub Desktop.
Save eevee/3877152 to your computer and use it in GitHub Desktop.
trait Context<T> {
fn enter() -> T;
fn exit();
fn with(block: fn(T)) {
block(self.enter());
self.exit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment