diff options
author | Muhammad Mominul Huque <[email protected]> | 2019-06-15 08:37:15 +0100 |
---|---|---|
committer | Muhammad Mominul Huque <[email protected]> | 2019-06-15 08:37:15 +0100 |
commit | ebb40c7f87d58fb74c8f3b4dfcb2704140599d65 (patch) | |
tree | a5446456867754ef3bd533f3b54c7ea1022f9cc4 /crates/gen_lsp_server/src | |
parent | f032eeb05f0b7d77e30cd6c5eea016cc5d649e3f (diff) |
cargo format
Diffstat (limited to 'crates/gen_lsp_server/src')
-rw-r--r-- | crates/gen_lsp_server/src/lib.rs | 3 | ||||
-rw-r--r-- | crates/gen_lsp_server/src/msg.rs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/crates/gen_lsp_server/src/lib.rs b/crates/gen_lsp_server/src/lib.rs index 7c4fbbee4..8e7697ed4 100644 --- a/crates/gen_lsp_server/src/lib.rs +++ b/crates/gen_lsp_server/src/lib.rs | |||
@@ -127,8 +127,7 @@ fn initialize( | |||
127 | sender.send(RawMessage::Response(resp)).unwrap(); | 127 | sender.send(RawMessage::Response(resp)).unwrap(); |
128 | match receiver.recv() { | 128 | match receiver.recv() { |
129 | Ok(RawMessage::Notification(n)) => { | 129 | Ok(RawMessage::Notification(n)) => { |
130 | n.cast::<Initialized>() | 130 | n.cast::<Initialized>().map_err(|_| "expected initialized notification")?; |
131 | .map_err(|_| "expected initialized notification")?; | ||
132 | } | 131 | } |
133 | _ => Err(format!("expected initialized notification"))?, | 132 | _ => Err(format!("expected initialized notification"))?, |
134 | } | 133 | } |
diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index 8138b84eb..2928e4f8b 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs | |||
@@ -182,8 +182,7 @@ fn read_msg_text(inp: &mut impl BufRead) -> Result<Option<String>> { | |||
182 | } | 182 | } |
183 | let mut parts = buf.splitn(2, ": "); | 183 | let mut parts = buf.splitn(2, ": "); |
184 | let header_name = parts.next().unwrap(); | 184 | let header_name = parts.next().unwrap(); |
185 | let header_value = | 185 | let header_value = parts.next().ok_or_else(|| format!("malformed header: {:?}", buf))?; |
186 | parts.next().ok_or_else(|| format!("malformed header: {:?}", buf))?; | ||
187 | if header_name == "Content-Length" { | 186 | if header_name == "Content-Length" { |
188 | size = Some(header_value.parse::<usize>()?); | 187 | size = Some(header_value.parse::<usize>()?); |
189 | } | 188 | } |