SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use serde_derive::{Serialize,Deserialize};
  2. use std::env::args;
  3. use std::fs::File;
  4. use std::io::prelude::*;
  5.  
  6. #[derive(Serialize,Deserialize,Debug)]
  7. struct User<'a>
  8. {
  9.     id: u32,
  10.     name: &'a str,
  11.  
  12. }
  13.  
  14. #[derive(Serialize,Deserialize,Debug)]
  15. struct UserList<'a:>
  16. {
  17.     #[serde(borrow)]
  18.     users: Vec<User<'a>>
  19. }
  20.  
  21. fn main()
  22. {
  23.     // let arg: Vec<_> = args().collect();
  24.     // let mut content = String::new();
  25.     // let filename = &arg[1];
  26.     // File::open(&filename).unwrap().read_to_string(&mut content).unwrap();
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top