File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -3830,14 +3830,20 @@ impl PrintThread {
38303830 // location to another.
38313831 let print = thread:: spawn ( move || {
38323832 let mut stderr = BufReader :: with_capacity ( 4096 , pipe_reader) ;
3833- let mut line = String :: with_capacity ( 20 ) ;
3834- let mut stdout = io:: stdout ( ) ;
3833+ let mut line = Vec :: with_capacity ( 20 ) ;
3834+ let stdout = io:: stdout ( ) ;
38353835
3836- // read_line returns 0 on Eof
3837- while stderr. read_line ( & mut line) . unwrap ( ) != 0 {
3838- writeln ! ( & mut stdout, "cargo:warning={}" , line) . ok ( ) ;
3836+ // read_until returns 0 on Eof
3837+ while stderr. read_until ( b'\n' , & mut line) . unwrap ( ) != 0 {
3838+ {
3839+ let mut stdout = stdout. lock ( ) ;
3840+
3841+ stdout. write_all ( b"cargo:warning=" ) . unwrap ( ) ;
3842+ stdout. write_all ( & line) . unwrap ( ) ;
3843+ stdout. write_all ( b"\n " ) . unwrap ( ) ;
3844+ }
38393845
3840- // read_line does not clear the buffer
3846+ // read_until does not clear the buffer
38413847 line. clear ( ) ;
38423848 }
38433849 } ) ;
You can’t perform that action at this time.
0 commit comments