mirror of
https://github.com/latex-lsp/texlab.git
synced 2025-12-23 09:19:21 +00:00
Fix handling of requests that return unit
This commit is contained in:
parent
954fb0bbb7
commit
61c81cc8e8
1 changed files with 4 additions and 2 deletions
|
|
@ -75,8 +75,10 @@ where
|
|||
let mut queue = await!(self.queue.lock());
|
||||
let sender = queue.remove(&id).expect("Unexpected response received");
|
||||
|
||||
let error = response.error.clone();
|
||||
let result = response.result.ok_or_else(|| error.unwrap());
|
||||
let result = match response.error {
|
||||
Some(why) => Err(why),
|
||||
None => Ok(response.result.unwrap_or(serde_json::Value::Null))
|
||||
};
|
||||
sender.send(result).unwrap();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue