Guest User

Untitled

a guest
Apr 26th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #[macro_use]
  2. extern crate serde_derive;
  3. extern crate serde;
  4.  
  5. mod other_crate {
  6. pub struct Annotation {
  7. pub name: String,
  8. }
  9. }
  10.  
  11. ////////////////////////////
  12.  
  13. use other_crate::{Annotation};
  14. use std::error::Error;
  15. use std::fs::File;
  16. use std::path::Path;
  17. extern crate serde_json;
  18.  
  19. #[derive(Serialize, Deserialize)]
  20. #[serde(remote = "Annotation")]
  21. struct AnnotationDef {
  22. name: String,
  23. }
  24.  
  25. fn read_fixture<'a, P: AsRef<Path>>(path: P) -> Result<AnnotationDef, Box<Error>> {
  26. let file = File::open(path)?;
  27. let u = serde_json::from_reader(file)?;
  28. Ok(u)
  29. }
  30.  
  31.  
  32. fn main () {
  33. }
Add Comment
Please, Sign In to add comment