@@ -19,7 +19,7 @@ use std::os::windows::process::CommandExt;
1919#[ cfg( windows) ]
2020const CREATE_NO_WINDOW : u32 = 0x0800_0000 ;
2121
22- use crate :: async_runtime:: { channel , spawn as spawn_task , Receiver } ;
22+ use crate :: async_runtime:: { block_on as block_on_task , channel , Receiver } ;
2323use os_pipe:: { pipe, PipeWriter } ;
2424use serde:: Serialize ;
2525use shared_child:: SharedChild ;
@@ -248,7 +248,7 @@ impl Command {
248248 let reader = BufReader :: new ( stdout_reader) ;
249249 for line in reader. lines ( ) {
250250 let tx_ = tx_. clone ( ) ;
251- spawn_task ( async move {
251+ block_on_task ( async move {
252252 let _ = match line {
253253 Ok ( line) => tx_. send ( CommandEvent :: Stdout ( line) ) . await ,
254254 Err ( e) => tx_. send ( CommandEvent :: Error ( e. to_string ( ) ) ) . await ,
@@ -264,7 +264,7 @@ impl Command {
264264 let reader = BufReader :: new ( stderr_reader) ;
265265 for line in reader. lines ( ) {
266266 let tx_ = tx_. clone ( ) ;
267- spawn_task ( async move {
267+ block_on_task ( async move {
268268 let _ = match line {
269269 Ok ( line) => tx_. send ( CommandEvent :: Stderr ( line) ) . await ,
270270 Err ( e) => tx_. send ( CommandEvent :: Error ( e. to_string ( ) ) ) . await ,
@@ -278,7 +278,7 @@ impl Command {
278278 Ok ( status) => {
279279 let _l = guard. write ( ) . unwrap ( ) ;
280280 commands ( ) . lock ( ) . unwrap ( ) . remove ( & child_. id ( ) ) ;
281- spawn_task ( async move {
281+ let _ = block_on_task ( async move {
282282 tx. send ( CommandEvent :: Terminated ( TerminatedPayload {
283283 code : status. code ( ) ,
284284 #[ cfg( windows) ]
@@ -291,7 +291,7 @@ impl Command {
291291 }
292292 Err ( e) => {
293293 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 } ) ;
295295 }
296296 } ;
297297 } ) ;
0 commit comments