From 6c0f7eafc34d54cc4d4883908741b6f33a7372dd Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sun, 15 Aug 2021 10:14:11 +0300 Subject: examples: continue handling output events --- helix-dap/examples/dap-dlv.rs | 16 +++++++++------- helix-dap/examples/dap-lldb.rs | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'helix-dap/examples') diff --git a/helix-dap/examples/dap-dlv.rs b/helix-dap/examples/dap-dlv.rs index cb920e32..c42559b9 100644 --- a/helix-dap/examples/dap-dlv.rs +++ b/helix-dap/examples/dap-dlv.rs @@ -11,13 +11,15 @@ struct LaunchArguments { } async fn output(mut output_event: Receiver) { - let body: OutputEventBody = - from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); - println!( - "> [{}] {}", - body.category.unwrap_or("unknown".to_owned()), - body.output - ); + loop { + let body: OutputEventBody = + from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); + println!( + "> [{}] {}", + body.category.unwrap_or("unknown".to_owned()), + body.output + ); + } } #[tokio::main] diff --git a/helix-dap/examples/dap-lldb.rs b/helix-dap/examples/dap-lldb.rs index 97d842ab..6fe666b2 100644 --- a/helix-dap/examples/dap-lldb.rs +++ b/helix-dap/examples/dap-lldb.rs @@ -11,13 +11,15 @@ struct LaunchArguments { } async fn output(mut output_event: Receiver) { - let body: OutputEventBody = - from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); - println!( - "> [{}] {}", - body.category.unwrap_or("unknown".to_owned()), - body.output - ); + loop { + let body: OutputEventBody = + from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); + println!( + "> [{}] {}", + body.category.unwrap_or("unknown".to_owned()), + body.output + ); + } } #[tokio::main] -- cgit v1.2.3-70-g09d2