Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fmt;
- enum MetaData {
- Webpage { title: String },
- Image { extension: String, resolution: (u64, u64), size: u64 },
- File { extension : String, size: u64 },
- }
- impl fmt::Display for MetaData {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match *self {
- MetaData::Webpage { title: ref x } => write!(f, "{}", x),
- _ => write!(f, "a")
- }
- }
- }
- fn main() {
- }
Add Comment
Please, Sign In to add comment