From d360af45bb2dda3f0f0fddbb130967dc06a2dd54 Mon Sep 17 00:00:00 2001 From: Mark Simulacrum Date: Tue, 4 Jul 2017 07:31:05 -0600 Subject: [PATCH] Migrate to serde_json entirely --- src/bootstrap/compile.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index ab4eec0199f0..79668efc0782 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -26,7 +26,7 @@ use std::str; use build_helper::{output, mtime, up_to_date}; use filetime::FileTime; -use rustc_serialize::json; +use serde_json; use util::{exe, libdir, is_dylib, copy}; use {Build, Compiler, Mode}; @@ -934,18 +934,18 @@ fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path) { let stdout = BufReader::new(child.stdout.take().unwrap()); for line in stdout.lines() { let line = t!(line); - let json = if line.starts_with("{") { - t!(line.parse::()) + let json: serde_json::Value = if line.starts_with("{") { + t!(serde_json::from_str(&line)) } else { // If this was informational, just print it out and continue println!("{}", line); continue }; - if json.find("reason").and_then(|j| j.as_string()) != Some("compiler-artifact") { + if json["reason"].as_str() != Some("compiler-artifact") { continue } for filename in json["filenames"].as_array().unwrap() { - let filename = filename.as_string().unwrap(); + let filename = filename.as_str().unwrap(); // Skip files like executables if !filename.ends_with(".rlib") && !filename.ends_with(".lib") &&