Fix issues in librustdoc
This commit is contained in:
@@ -408,10 +408,9 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
|
|||||||
// "crate": { parsed crate ... },
|
// "crate": { parsed crate ... },
|
||||||
// "plugins": { output of plugins ... }
|
// "plugins": { output of plugins ... }
|
||||||
// }
|
// }
|
||||||
let mut json = box std::collections::TreeMap::new();
|
let mut json = std::collections::TreeMap::new();
|
||||||
json.insert("schema".to_string(),
|
json.insert("schema".to_string(), json::String(SCHEMA_VERSION.to_string()));
|
||||||
json::String(SCHEMA_VERSION.to_string()));
|
let plugins_json = res.move_iter()
|
||||||
let plugins_json = box res.move_iter()
|
|
||||||
.filter_map(|opt| {
|
.filter_map(|opt| {
|
||||||
match opt {
|
match opt {
|
||||||
None => None,
|
None => None,
|
||||||
@@ -429,7 +428,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
|
|||||||
let mut encoder = json::Encoder::new(&mut w as &mut io::Writer);
|
let mut encoder = json::Encoder::new(&mut w as &mut io::Writer);
|
||||||
krate.encode(&mut encoder).unwrap();
|
krate.encode(&mut encoder).unwrap();
|
||||||
}
|
}
|
||||||
str::from_utf8(w.unwrap().as_slice()).unwrap().to_string()
|
str::from_utf8_owned(w.unwrap()).unwrap()
|
||||||
};
|
};
|
||||||
let crate_json = match json::from_str(crate_json_str.as_slice()) {
|
let crate_json = match json::from_str(crate_json_str.as_slice()) {
|
||||||
Ok(j) => j,
|
Ok(j) => j,
|
||||||
@@ -440,6 +439,5 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
|
|||||||
json.insert("plugins".to_string(), json::Object(plugins_json));
|
json.insert("plugins".to_string(), json::Object(plugins_json));
|
||||||
|
|
||||||
let mut file = try!(File::create(&dst));
|
let mut file = try!(File::create(&dst));
|
||||||
try!(json::Object(json).to_writer(&mut file));
|
json::Object(json).to_writer(&mut file)
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user