diff options
author | Blaž Hrastnik | 2021-08-16 04:59:02 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-20 04:43:54 +0000 |
commit | 184abdc51061bd1636f31edcb51d71d0362a3d83 (patch) | |
tree | 92ae383359a6cf430e8e2c8a7bcbb756df41eb10 /helix-dap/examples | |
parent | 3a9e1c305b1ab080e77a2d6a405710fd1f20015e (diff) |
dap: Significantly simplify code using the Request trait
Diffstat (limited to 'helix-dap/examples')
-rw-r--r-- | helix-dap/examples/dap-dlv.rs | 6 | ||||
-rw-r--r-- | helix-dap/examples/dap-lldb.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/helix-dap/examples/dap-dlv.rs b/helix-dap/examples/dap-dlv.rs index a18ec5e2..352c2144 100644 --- a/helix-dap/examples/dap-dlv.rs +++ b/helix-dap/examples/dap-dlv.rs @@ -1,4 +1,4 @@ -use helix_dap::{Client, Event, OutputEventBody, Result, SourceBreakpoint, StoppedEventBody}; +use helix_dap::{events, Client, Event, Result, SourceBreakpoint}; use serde::{Deserialize, Serialize}; use serde_json::from_value; use tokio::sync::mpsc::Receiver; @@ -12,7 +12,7 @@ struct LaunchArguments { async fn output(mut output_event: Receiver<Event>) { loop { - let body: OutputEventBody = + let body: events::Output = from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); println!( "> [{}] {}", @@ -77,7 +77,7 @@ pub async fn main() -> Result<()> { println!("configurationDone: {:?}", client.configuration_done().await); - let stop: StoppedEventBody = + let stop: events::Stopped = from_value(stopped_event.recv().await.unwrap().body.unwrap()).unwrap(); println!("stopped: {:?}", stop); diff --git a/helix-dap/examples/dap-lldb.rs b/helix-dap/examples/dap-lldb.rs index 5e10ebed..85ff2762 100644 --- a/helix-dap/examples/dap-lldb.rs +++ b/helix-dap/examples/dap-lldb.rs @@ -1,4 +1,4 @@ -use helix_dap::{Client, Event, OutputEventBody, Result, SourceBreakpoint, StoppedEventBody}; +use helix_dap::{events, Client, Event, Result, SourceBreakpoint}; use serde::{Deserialize, Serialize}; use serde_json::from_value; use tokio::sync::mpsc::Receiver; @@ -12,7 +12,7 @@ struct LaunchArguments { async fn output(mut output_event: Receiver<Event>) { loop { - let body: OutputEventBody = + let body: events::Output = from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); println!( "> [{}] {}", @@ -77,7 +77,7 @@ pub async fn main() -> Result<()> { println!("configurationDone: {:?}", client.configuration_done().await); - let stop: StoppedEventBody = + let stop: events::Stopped = from_value(stopped_event.recv().await.unwrap().body.unwrap()).unwrap(); println!("stopped: {:?}", stop); |