diff options
author | Aleksey Kladov <[email protected]> | 2018-12-22 09:13:20 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-22 09:38:24 +0000 |
commit | 90f20f8c539843f53a7a2b1cfb83b3673ec78534 (patch) | |
tree | 57e252955404bba9978f3a3a3c288a0636a87173 /crates/gen_lsp_server | |
parent | 94241cec04f0dfa4aa725f114abc0405f65b00b9 (diff) |
less verbose debug
Diffstat (limited to 'crates/gen_lsp_server')
-rw-r--r-- | crates/gen_lsp_server/src/msg.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index af901d0d2..f68cbc541 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs | |||
@@ -152,12 +152,18 @@ impl RawNotification { | |||
152 | params: to_value(params).unwrap(), | 152 | params: to_value(params).unwrap(), |
153 | } | 153 | } |
154 | } | 154 | } |
155 | pub fn is<N>(&self) -> bool | ||
156 | where | ||
157 | N: Notification, | ||
158 | { | ||
159 | self.method == N::METHOD | ||
160 | } | ||
155 | pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification> | 161 | pub fn cast<N>(self) -> ::std::result::Result<N::Params, RawNotification> |
156 | where | 162 | where |
157 | N: Notification, | 163 | N: Notification, |
158 | N::Params: serde::de::DeserializeOwned, | 164 | N::Params: serde::de::DeserializeOwned, |
159 | { | 165 | { |
160 | if self.method != N::METHOD { | 166 | if !self.is::<N>() { |
161 | return Err(self); | 167 | return Err(self); |
162 | } | 168 | } |
163 | Ok(from_value(self.params).unwrap()) | 169 | Ok(from_value(self.params).unwrap()) |