diff options
author | Blaž Hrastnik | 2021-03-31 14:42:16 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-31 14:42:16 +0000 |
commit | ceea5eacd814c5bbd8c6789610c87a882e3d72cf (patch) | |
tree | 1b8aef96c10764e761539b8f6fb15abc78f07a61 /helix-lsp | |
parent | 15c9a33ebcc18f6abf983785032ffc9762c89203 (diff) |
clippy lint
Diffstat (limited to 'helix-lsp')
-rw-r--r-- | helix-lsp/src/client.rs | 22 | ||||
-rw-r--r-- | helix-lsp/src/transport.rs | 8 |
2 files changed, 15 insertions, 15 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 1d84c4f3..74f5fa06 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -384,11 +384,13 @@ impl Client { let capabilities = self.capabilities.as_ref().unwrap(); let sync_capabilities = match capabilities.text_document_sync { - Some(lsp::TextDocumentSyncCapability::Kind(kind)) => kind, - Some(lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions { - change: Some(kind), - .. - })) => kind, + Some( + lsp::TextDocumentSyncCapability::Kind(kind) + | lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions { + change: Some(kind), + .. + }), + ) => kind, // None | SyncOptions { changes: None } _ => return Ok(()), }; @@ -537,9 +539,8 @@ impl Client { let capabilities = self.capabilities.as_ref().unwrap(); // check if we're able to format - let _capabilities = match capabilities.document_formatting_provider { - Some(lsp::OneOf::Left(true)) => (), - Some(lsp::OneOf::Right(_)) => (), + match capabilities.document_formatting_provider { + Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_)) => (), // None | Some(false) _ => return Ok(Vec::new()), }; @@ -567,9 +568,8 @@ impl Client { let capabilities = self.capabilities.as_ref().unwrap(); // check if we're able to format - let _capabilities = match capabilities.document_range_formatting_provider { - Some(lsp::OneOf::Left(true)) => (), - Some(lsp::OneOf::Right(_)) => (), + match capabilities.document_range_formatting_provider { + Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_)) => (), // None | Some(false) _ => return Ok(Vec::new()), }; diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs index ff1eedaf..d3e25b9c 100644 --- a/helix-lsp/src/transport.rs +++ b/helix-lsp/src/transport.rs @@ -19,7 +19,7 @@ use smol::{ Executor, }; -pub(crate) enum Payload { +pub enum Payload { Request { chan: Sender<Result<Value>>, value: jsonrpc::MethodCall, @@ -40,7 +40,7 @@ enum Message { Call(jsonrpc::Call), } -pub(crate) struct Transport { +pub struct Transport { incoming: Sender<jsonrpc::Call>, outgoing: Receiver<Payload>, @@ -68,8 +68,8 @@ impl Transport { stderr, incoming, outgoing, - pending_requests: Default::default(), - headers: Default::default(), + pending_requests: HashMap::default(), + headers: HashMap::default(), }; ex.spawn(transport.duplex()).detach(); |