Skip to content

Commit 3513ebd

Browse files
committed
---
yaml --- r: 122638 b: refs/heads/snap-stage3 c: 035914e h: refs/heads/master v: v3
1 parent 736fe50 commit 3513ebd

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 1bff1ff810dcfa8064c11e2b84473f053d1f69f1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fb96cbba4185772dae47f3f3bddbaa8698426d93
4+
refs/heads/snap-stage3: 035914edcfb19bf531eb633fba54c68b53fbe8d8
55
refs/heads/try: 2e9d9477b848cec778ca3f07ecdf0aea6ade23de
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)