Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created February 13, 2014 12:25
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 alexcrichton/8974215 to your computer and use it in GitHub Desktop.
Save alexcrichton/8974215 to your computer and use it in GitHub Desktop.
#[feature(macro_rules)];
use std::io::MemWriter;
macro_rules! write(
($dst:expr, $($arg:tt)*) => ({
let dst: &mut Writer = $dst;
format_args!(|args| { ::std::fmt::write(dst, args) }, $($arg)*)
})
)
fn main() {
let mut w = MemWriter::new();
(write!(&mut w, "")).unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment