types: simplify working with client's launch args

pull/574/head
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(),
};
println!(
"launch: {:?}",
client.launch(serde_json::to_value(args)?).await
);
println!("launch: {:?}", client.launch(args).await);
println!(
"breakpoints: {:#?}",

@ -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

Loading…
Cancel
Save