diff options
author | Blaž Hrastnik | 2021-02-24 07:07:39 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-02-24 07:07:39 +0000 |
commit | 87a6d4e73615e17559b99afa065799a38fe6c39e (patch) | |
tree | 23e437304421ec88a355e3ef887cf6cb4a322591 /helix-lsp/src/transport.rs | |
parent | c6456d04b9f16ed8f5ad0f256a38218b514de5dc (diff) |
minor: Simplify some code.
Diffstat (limited to 'helix-lsp/src/transport.rs')
-rw-r--r-- | helix-lsp/src/transport.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs index 74ecde5e..ff1eedaf 100644 --- a/helix-lsp/src/transport.rs +++ b/helix-lsp/src/transport.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::io; use log::{error, info}; @@ -128,7 +129,7 @@ impl Transport { Ok(()) } - pub async fn send_payload(&mut self, payload: Payload) -> anyhow::Result<()> { + pub async fn send_payload(&mut self, payload: Payload) -> io::Result<()> { match payload { Payload::Request { chan, value } => { self.pending_requests.insert(value.id.clone(), chan); @@ -147,7 +148,7 @@ impl Transport { } } - pub async fn send(&mut self, request: String) -> anyhow::Result<()> { + pub async fn send(&mut self, request: String) -> io::Result<()> { info!("-> {}", request); // send the headers @@ -174,7 +175,7 @@ impl Transport { Ok(()) } - async fn recv_response(&mut self, output: jsonrpc::Output) -> anyhow::Result<()> { + async fn recv_response(&mut self, output: jsonrpc::Output) -> io::Result<()> { let (id, result) = match output { jsonrpc::Output::Success(jsonrpc::Success { id, result, .. }) => { info!("<- {}", result); |