Skip to content

Instantly share code, notes, and snippets.

@14427
Created December 11, 2012 21:49
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 14427/4262524 to your computer and use it in GitHub Desktop.
Save 14427/4262524 to your computer and use it in GitHub Desktop.
struct Noter {
note: &fn(),
drop {
if task::failing() {
(self.note)();
}
}
}
macro_rules! note (
($arg:expr) => (
&Noter { note: || io::println(fmt!("Note: %?", $arg)) }
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment