Skip to content

Instantly share code, notes, and snippets.

@Manishearth
Created October 25, 2014 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Manishearth/4db6b5873dd0f4eef437 to your computer and use it in GitHub Desktop.
Save Manishearth/4db6b5873dd0f4eef437 to your computer and use it in GitHub Desktop.
pub trait Show {
#[scheme(
TupleLike(try!(fmt.write_str(concat!($_name, "("))); try!($_); fmt.write(b")")),
AnonymousList(try!($_);try!(fmt.write_str(","))),
NamedList(try!(fmt.write_str(concat!($_name,":")));try!($_);try!(fmt.write_str(","))),
StructLike(try!(fmt.write_str(concat!($_name, "{"))); try!($_); fmt.write(b"}")),
UnitLike(fmt.write_str($_name))
)]
fn fmt(&self, fmt: &mut Formatter) -> Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment