Skip to content

Commit 7d4df95

Browse files
Migrate to serde_json entirely
1 parent 6221c76 commit 7d4df95

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bootstrap/compile.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::str;
2626

2727
use build_helper::{output, mtime, up_to_date};
2828
use filetime::FileTime;
29-
use rustc_serialize::json;
29+
use serde_json;
3030

3131
use util::{exe, libdir, is_dylib, copy};
3232
use {Build, Compiler, Mode};
@@ -934,18 +934,18 @@ fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path) {
934934
let stdout = BufReader::new(child.stdout.take().unwrap());
935935
for line in stdout.lines() {
936936
let line = t!(line);
937-
let json = if line.starts_with("{") {
938-
t!(line.parse::<json::Json>())
937+
let json: serde_json::Value = if line.starts_with("{") {
938+
t!(serde_json::from_str(&line))
939939
} else {
940940
// If this was informational, just print it out and continue
941941
println!("{}", line);
942942
continue
943943
};
944-
if json.find("reason").and_then(|j| j.as_string()) != Some("compiler-artifact") {
944+
if json["reason"].as_str() != Some("compiler-artifact") {
945945
continue
946946
}
947947
for filename in json["filenames"].as_array().unwrap() {
948-
let filename = filename.as_string().unwrap();
948+
let filename = filename.as_str().unwrap();
949949
// Skip files like executables
950950
if !filename.ends_with(".rlib") &&
951951
!filename.ends_with(".lib") &&

0 commit comments

Comments
 (0)