types: simplify working with client's launch args
This commit is contained in:
parent
6bb653f820
commit
aac586b546
2 changed files with 4 additions and 6 deletions
|
@ -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…
Reference in a new issue