Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[macro_use]
- extern crate serde_derive;
- extern crate serde;
- mod other_crate {
- pub struct Annotation {
- pub name: String,
- }
- }
- ////////////////////////////
- use other_crate::{Annotation};
- use std::error::Error;
- use std::fs::File;
- use std::path::Path;
- extern crate serde_json;
- #[derive(Serialize, Deserialize)]
- #[serde(remote = "Annotation")]
- struct AnnotationDef {
- name: String,
- }
- fn read_fixture<'a, P: AsRef<Path>>(path: P) -> Result<AnnotationDef, Box<Error>> {
- let file = File::open(path)?;
- let u = serde_json::from_reader(file)?;
- Ok(u)
- }
- fn main () {
- }
Add Comment
Please, Sign In to add comment