Guest User

Untitled

a guest
Jun 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. use std::fmt;
  2.  
  3.  
  4. enum MetaData {
  5. Webpage { title: String },
  6. Image { extension: String, resolution: (u64, u64), size: u64 },
  7. File { extension : String, size: u64 },
  8. }
  9.  
  10. impl fmt::Display for MetaData {
  11. fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  12. match *self {
  13. MetaData::Webpage { title: ref x } => write!(f, "{}", x),
  14. _ => write!(f, "a")
  15. }
  16. }
  17. }
  18.  
  19. fn main() {
  20.  
  21. }
Add Comment
Please, Sign In to add comment