Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/lsp-server/src/msg.rs')
-rw-r--r--lib/lsp-server/src/msg.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lsp-server/src/msg.rs b/lib/lsp-server/src/msg.rs
index 11f98f5079..074bc43388 100644
--- a/lib/lsp-server/src/msg.rs
+++ b/lib/lsp-server/src/msg.rs
@@ -181,15 +181,15 @@ impl Message {
Ok(Some(msg))
}
- pub fn write(self, w: &mut impl Write) -> io::Result<()> {
+ pub fn write(&self, w: &mut impl Write) -> io::Result<()> {
self._write(w)
}
- fn _write(self, w: &mut dyn Write) -> io::Result<()> {
+ fn _write(&self, w: &mut dyn Write) -> io::Result<()> {
#[derive(Serialize)]
- struct JsonRpc {
+ struct JsonRpc<'a> {
jsonrpc: &'static str,
#[serde(flatten)]
- msg: Message,
+ msg: &'a Message,
}
let text = serde_json::to_string(&JsonRpc { jsonrpc: "2.0", msg: self })?;
write_msg_text(w, &text)