types: simplify working with client's launch args

imgbot
Dmitry Sharshakov 3 years ago committed by Blaž Hrastnik
parent 6bb653f820
commit aac586b546

@ -33,10 +33,7 @@ pub async fn main() -> Result<()> {
program: "/tmp/godebug/main".to_owned(), program: "/tmp/godebug/main".to_owned(),
}; };
println!( println!("launch: {:?}", client.launch(args).await);
"launch: {:?}",
client.launch(serde_json::to_value(args)?).await
);
println!( println!(
"breakpoints: {:#?}", "breakpoints: {:#?}",

@ -372,8 +372,9 @@ impl Client {
Ok(()) Ok(())
} }
pub async fn launch(&mut self, args: Value) -> Result<()> { pub async fn launch(&mut self, args: impl Serialize) -> Result<()> {
self.request("launch".to_owned(), Some(args)).await?; self.request("launch".to_owned(), to_value(args).ok())
.await?;
match self match self
.server_rx .server_rx

Loading…
Cancel
Save