daily pastebin goal
81%
SHARE
TWEET

Untitled

a guest Dec 18th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #[macro_use]
  2. extern crate serde_derive;
  3.  
  4. extern crate serde;
  5. extern crate serde_json;
  6.  
  7. use std::fs::File;
  8. use std::io::BufReader;
  9. use std::io::Read;
  10.  
  11. #[derive(Deserialize, Debug)]
  12. enum BuildStatus {
  13.     #[serde(rename = "0")]
  14.     Success,
  15. }
  16.  
  17. #[derive(Deserialize, Debug)]
  18. struct Build {
  19.     buildstatus: BuildStatus,
  20. }
  21.  
  22. fn main() {
  23.  
  24.     let u: Build = serde_json::from_str(r#"{"buildstatus": 0}"#).unwrap();
  25.     println!("{:?}", u);
  26. }
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