Skip to content

Commit 538321b

Browse files
author
Oliver Schneider
committed
fix fallout from PrettyEncoder and Encoder merge
1 parent 52f7310 commit 538321b

File tree

7 files changed

+161
-113
lines changed

7 files changed

+161
-113
lines changed

src/librustc_driver/driver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
133133

134134
if sess.opts.debugging_opts & config::AST_JSON_NOEXPAND != 0 {
135135
let mut stdout = io::BufferedWriter::new(io::stdout());
136-
let mut json = json::PrettyEncoder::new(&mut stdout);
136+
let mut json = json::Encoder::new_pretty(&mut stdout);
137137
// unwrapping so IoError isn't ignored
138138
krate.encode(&mut json).unwrap();
139139
}
@@ -318,7 +318,7 @@ pub fn assign_node_ids_and_map<'ast>(sess: &Session,
318318

319319
if sess.opts.debugging_opts & config::AST_JSON != 0 {
320320
let mut stdout = io::BufferedWriter::new(io::stdout());
321-
let mut json = json::PrettyEncoder::new(&mut stdout);
321+
let mut json = json::Encoder::new_pretty(&mut stdout);
322322
// unwrapping so IoError isn't ignored
323323
map.krate().encode(&mut json).unwrap();
324324
}

src/librustdoc/html/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ impl Context {
10951095
try!(self.recurse(stability.name.clone(), |this| {
10961096
let json_dst = &this.dst.join("stability.json");
10971097
let mut json_out = BufferedWriter::new(try!(File::create(json_dst)));
1098-
try!(stability.encode(&mut json::Encoder::new(&mut json_out)));
1098+
try!(stability.encode(&mut json::Encoder::new_compact(&mut json_out)));
10991099

11001100
let mut title = stability.name.clone();
11011101
title.push_str(" - Stability dashboard");

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
491491
let crate_json_str = {
492492
let mut w = Vec::new();
493493
{
494-
let mut encoder = json::Encoder::new(&mut w as &mut io::Writer);
494+
let mut encoder = json::Encoder::new_compact(&mut w as &mut io::Writer);
495495
krate.encode(&mut encoder).unwrap();
496496
}
497497
String::from_utf8(w).unwrap()

0 commit comments

Comments
 (0)