Guest User

Untitled

a guest
Mar 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #[allow(dead_code)]
  2. struct Thing {
  3. x: usize,
  4. y: &'static str,
  5. more: Vec<String>
  6. }
  7.  
  8. macro_rules! th {
  9. ($x:expr, $y:expr) => (Thing{x: $x, y: $y, more: vec![]})
  10. }
  11.  
  12. fn main() {
  13. let x = 2usize;
  14. let y = "bar";
  15. let _thing = th!(x, y);
  16. }
Add Comment
Please, Sign In to add comment