aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-dap/examples/dap-basic.rs5
-rw-r--r--helix-dap/src/client.rs5
2 files changed, 4 insertions, 6 deletions
diff --git a/helix-dap/examples/dap-basic.rs b/helix-dap/examples/dap-basic.rs
index 35664458..82e14702 100644
--- a/helix-dap/examples/dap-basic.rs
+++ b/helix-dap/examples/dap-basic.rs
@@ -33,10 +33,7 @@ pub async fn main() -> Result<()> {
program: "/tmp/godebug/main".to_owned(),
};
- println!(
- "launch: {:?}",
- client.launch(serde_json::to_value(args)?).await
- );
+ println!("launch: {:?}", client.launch(args).await);
println!(
"breakpoints: {:#?}",
diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs
index 7971dc54..f5aa8569 100644
--- a/helix-dap/src/client.rs
+++ b/helix-dap/src/client.rs
@@ -372,8 +372,9 @@ impl Client {
Ok(())
}
- pub async fn launch(&mut self, args: Value) -> Result<()> {
- self.request("launch".to_owned(), Some(args)).await?;
+ pub async fn launch(&mut self, args: impl Serialize) -> Result<()> {
+ self.request("launch".to_owned(), to_value(args).ok())
+ .await?;
match self
.server_rx