11#![ deny( warnings) ]
22
3- use std:: io:: { self , Write } ;
3+ use std:: io:: { self , BufReader , Write } ;
44use std:: path:: { Component , Path } ;
55use std:: process:: { Command , Stdio } ;
66use std:: { env, str} ;
77
8- use cargo_metadata:: { parse_messages , Artifact , CargoOpt , Message , Metadata , MetadataCommand } ;
8+ use cargo_metadata:: { Artifact , CargoOpt , Message , Metadata , MetadataCommand } ;
99use clap:: { App , AppSettings , Arg } ;
1010use failure:: bail;
1111use rustc_cfg:: Cfg ;
@@ -241,10 +241,10 @@ fn determine_artifact(
241241 }
242242
243243 let mut child = cargo. spawn ( ) ?;
244- let stdout = child. stdout . take ( ) . expect ( "Pipe to cargo process failed" ) ;
244+ let stdout = BufReader :: new ( child. stdout . take ( ) . expect ( "Pipe to cargo process failed" ) ) ;
245245
246246 // Note: We call `collect` to ensure we don't block stdout which could prevent the process from exiting
247- let messages = parse_messages ( stdout) . collect :: < Vec < _ > > ( ) ;
247+ let messages = Message :: parse_stream ( stdout) . collect :: < Vec < _ > > ( ) ;
248248
249249 let status = child. wait ( ) ?;
250250 if !status. success ( ) {
@@ -255,7 +255,9 @@ fn determine_artifact(
255255 for message in messages {
256256 match message? {
257257 Message :: CompilerArtifact ( artifact) => {
258- if metadata. workspace_members . contains ( & artifact. package_id ) && build_type. matches ( & artifact) {
258+ if metadata. workspace_members . contains ( & artifact. package_id )
259+ && build_type. matches ( & artifact)
260+ {
259261 if wanted_artifact. is_some ( ) {
260262 bail ! ( "Can only have one matching artifact but found several" ) ;
261263 }
@@ -452,7 +454,7 @@ To see all the flags the proxied tool accepts run `cargo-{} -- -help`.{}",
452454
453455 match tool {
454456 // Tools that don't need a build
455- Tool :: Ar | Tool :: Lld | Tool :: Profdata => { } ,
457+ Tool :: Ar | Tool :: Lld | Tool :: Profdata => { }
456458 // for some tools we change the CWD (current working directory) and
457459 // make the artifact path relative. This makes the path that the
458460 // tool will print easier to read. e.g. `libfoo.rlib` instead of
0 commit comments