examples: continue handling output events
commit6c0f7eafc34d54cc4d4883908741b6f33a7372dd
authorDmitry Sharshakov <d3dx12.xx@gmail.com>
dateSun 15 Aug 2021, 10:14 (5 years ago)
parent279db98
helix-dap/examples/dap-dlv.rs+9−7
@@ -11,13 +11,15 @@ struct LaunchArguments {
1111}
1212
1313async fn output(mut output_event: Receiver<Event>) {
14− let body: OutputEventBody =
15− from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
16− println!(
17− "> [{}] {}",
18− body.category.unwrap_or("unknown".to_owned()),
19− body.output
20− );
14+ loop {
15+ let body: OutputEventBody =
16+ from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
17+ println!(
18+ "> [{}] {}",
19+ body.category.unwrap_or("unknown".to_owned()),
20+ body.output
21+ );
22+ }
2123}
2224
2325#[tokio::main]
helix-dap/examples/dap-lldb.rs+9−7
@@ -11,13 +11,15 @@ struct LaunchArguments {
1111}
1212
1313async fn output(mut output_event: Receiver<Event>) {
14− let body: OutputEventBody =
15− from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
16− println!(
17− "> [{}] {}",
18− body.category.unwrap_or("unknown".to_owned()),
19− body.output
20− );
14+ loop {
15+ let body: OutputEventBody =
16+ from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap();
17+ println!(
18+ "> [{}] {}",
19+ body.category.unwrap_or("unknown".to_owned()),
20+ body.output
21+ );
22+ }
2123}
2224
2325#[tokio::main]