Skip to content

Commit ad80d24

Browse files
committed
---
yaml --- r: 152978 b: refs/heads/try2 c: 035914e h: refs/heads/master v: v3
1 parent 4471d89 commit ad80d24

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: fb96cbba4185772dae47f3f3bddbaa8698426d93
8+
refs/heads/try2: 035914edcfb19bf531eb633fba54c68b53fbe8d8
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustdoc/lib.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,17 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
408408
// "crate": { parsed crate ... },
409409
// "plugins": { output of plugins ... }
410410
// }
411-
let mut json = box std::collections::TreeMap::new();
412-
json.insert("schema".to_string(),
413-
json::String(SCHEMA_VERSION.to_string()));
414-
let plugins_json = box res.move_iter()
415-
.filter_map(|opt| {
416-
match opt {
417-
None => None,
418-
Some((string, json)) => {
419-
Some((string.to_string(), json))
420-
}
411+
let mut json = std::collections::TreeMap::new();
412+
json.insert("schema".to_string(), json::String(SCHEMA_VERSION.to_string()));
413+
let plugins_json = res.move_iter()
414+
.filter_map(|opt| {
415+
match opt {
416+
None => None,
417+
Some((string, json)) => {
418+
Some((string.to_string(), json))
421419
}
422-
}).collect();
420+
}
421+
}).collect();
423422

424423
// FIXME #8335: yuck, Rust -> str -> JSON round trip! No way to .encode
425424
// straight to the Rust JSON representation.
@@ -429,7 +428,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
429428
let mut encoder = json::Encoder::new(&mut w as &mut io::Writer);
430429
krate.encode(&mut encoder).unwrap();
431430
}
432-
str::from_utf8(w.unwrap().as_slice()).unwrap().to_string()
431+
str::from_utf8_owned(w.unwrap()).unwrap()
433432
};
434433
let crate_json = match json::from_str(crate_json_str.as_slice()) {
435434
Ok(j) => j,
@@ -440,6 +439,5 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
440439
json.insert("plugins".to_string(), json::Object(plugins_json));
441440

442441
let mut file = try!(File::create(&dst));
443-
try!(json::Object(json).to_writer(&mut file));
444-
Ok(())
442+
json::Object(json).to_writer(&mut file)
445443
}

0 commit comments

Comments
 (0)