File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,14 @@ use crate::{
44 tempfile:: NamedTempfile ,
55 Error , ErrorKind , OutputKind ,
66} ;
7- use std:: io:: Read ;
87use std:: {
98 borrow:: Cow ,
109 collections:: HashMap ,
1110 env,
1211 ffi:: { OsStr , OsString } ,
1312 io:: Write ,
1413 path:: { Path , PathBuf } ,
15- process:: { Command , Stdio } ,
14+ process:: { Command , Output , Stdio } ,
1615 sync:: RwLock ,
1716} ;
1817
@@ -224,16 +223,13 @@ impl Tool {
224223 let mut captured_cargo_output = compiler_detect_output. clone ( ) ;
225224 captured_cargo_output. output = OutputKind :: Capture ;
226225 captured_cargo_output. warnings = true ;
227- let mut child = spawn ( & mut cmd, & captured_cargo_output) ?;
226+ let Output {
227+ status,
228+ stdout,
229+ stderr,
230+ } = spawn ( & mut cmd, & captured_cargo_output) ?. wait_with_output ( ) ?;
228231
229- let mut out = vec ! [ ] ;
230- let mut err = vec ! [ ] ;
231- child. stdout . take ( ) . unwrap ( ) . read_to_end ( & mut out) ?;
232- child. stderr . take ( ) . unwrap ( ) . read_to_end ( & mut err) ?;
233-
234- let status = child. wait ( ) ?;
235-
236- let stdout = if [ & out, & err]
232+ let stdout = if [ & stdout, & stderr]
237233 . iter ( )
238234 . any ( |o| String :: from_utf8_lossy ( o) . contains ( "-Wslash-u-filename" ) )
239235 {
@@ -251,7 +247,7 @@ impl Tool {
251247 ) ) ;
252248 }
253249
254- out
250+ stdout
255251 } ;
256252
257253 let stdout = String :: from_utf8_lossy ( & stdout) ;
You can’t perform that action at this time.
0 commit comments