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 {
3830
3830
// location to another.
3831
3831
let print = thread:: spawn ( move || {
3832
3832
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 ( ) ;
3835
3835
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
+ }
3839
3845
3840
- // read_line does not clear the buffer
3846
+ // read_until does not clear the buffer
3841
3847
line. clear ( ) ;
3842
3848
}
3843
3849
} ) ;
You can’t perform that action at this time.
0 commit comments