File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,20 @@ impl WritableTarget {
67
67
let buf = buf. as_bytes ( ) ;
68
68
match self {
69
69
WritableTarget :: WriteStdout => {
70
- write ! ( std:: io:: stdout( ) , "{}" , String :: from_utf8_lossy( buf) ) ?
70
+ let mut stream = std:: io:: stdout ( ) . lock ( ) ;
71
+ write ! ( stream, "{}" , String :: from_utf8_lossy( buf) ) ?;
71
72
}
72
73
WritableTarget :: PrintStdout => print ! ( "{}" , String :: from_utf8_lossy( buf) ) ,
73
74
WritableTarget :: WriteStderr => {
74
- write ! ( std:: io:: stderr( ) , "{}" , String :: from_utf8_lossy( buf) ) ?
75
+ let mut stream = std:: io:: stderr ( ) . lock ( ) ;
76
+ write ! ( stream, "{}" , String :: from_utf8_lossy( buf) ) ?;
75
77
}
76
78
WritableTarget :: PrintStderr => eprint ! ( "{}" , String :: from_utf8_lossy( buf) ) ,
77
79
// Safety: If the target type is `Pipe`, `target_pipe` will always be non-empty.
78
- WritableTarget :: Pipe ( pipe) => pipe. lock ( ) . unwrap ( ) . write_all ( buf) ?,
80
+ WritableTarget :: Pipe ( pipe) => {
81
+ let mut stream = pipe. lock ( ) . unwrap ( ) ;
82
+ write ! ( stream, "{}" , String :: from_utf8_lossy( buf) ) ?;
83
+ }
79
84
}
80
85
81
86
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments