@@ -19,7 +19,7 @@ use std::os::windows::process::CommandExt;
19
19
#[ cfg( windows) ]
20
20
const CREATE_NO_WINDOW : u32 = 0x0800_0000 ;
21
21
22
- use crate :: async_runtime:: { channel , spawn as spawn_task , Receiver } ;
22
+ use crate :: async_runtime:: { block_on as block_on_task , channel , Receiver } ;
23
23
use os_pipe:: { pipe, PipeWriter } ;
24
24
use serde:: Serialize ;
25
25
use shared_child:: SharedChild ;
@@ -248,7 +248,7 @@ impl Command {
248
248
let reader = BufReader :: new ( stdout_reader) ;
249
249
for line in reader. lines ( ) {
250
250
let tx_ = tx_. clone ( ) ;
251
- spawn_task ( async move {
251
+ block_on_task ( async move {
252
252
let _ = match line {
253
253
Ok ( line) => tx_. send ( CommandEvent :: Stdout ( line) ) . await ,
254
254
Err ( e) => tx_. send ( CommandEvent :: Error ( e. to_string ( ) ) ) . await ,
@@ -264,7 +264,7 @@ impl Command {
264
264
let reader = BufReader :: new ( stderr_reader) ;
265
265
for line in reader. lines ( ) {
266
266
let tx_ = tx_. clone ( ) ;
267
- spawn_task ( async move {
267
+ block_on_task ( async move {
268
268
let _ = match line {
269
269
Ok ( line) => tx_. send ( CommandEvent :: Stderr ( line) ) . await ,
270
270
Err ( e) => tx_. send ( CommandEvent :: Error ( e. to_string ( ) ) ) . await ,
@@ -278,7 +278,7 @@ impl Command {
278
278
Ok ( status) => {
279
279
let _l = guard. write ( ) . unwrap ( ) ;
280
280
commands ( ) . lock ( ) . unwrap ( ) . remove ( & child_. id ( ) ) ;
281
- spawn_task ( async move {
281
+ let _ = block_on_task ( async move {
282
282
tx. send ( CommandEvent :: Terminated ( TerminatedPayload {
283
283
code : status. code ( ) ,
284
284
#[ cfg( windows) ]
@@ -291,7 +291,7 @@ impl Command {
291
291
}
292
292
Err ( e) => {
293
293
let _l = guard. write ( ) . unwrap ( ) ;
294
- spawn_task ( async move { tx. send ( CommandEvent :: Error ( e. to_string ( ) ) ) . await } ) ;
294
+ let _ = block_on_task ( async move { tx. send ( CommandEvent :: Error ( e. to_string ( ) ) ) . await } ) ;
295
295
}
296
296
} ;
297
297
} ) ;
0 commit comments