From 6eb45c1c2be0fb780c4160aaa93c8d3d81e607e2 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Wed, 27 Feb 2019 12:57:59 +0200 Subject: Remove RawResponse::empty() --- crates/gen_lsp_server/src/msg.rs | 5 ----- crates/ra_lsp_server/src/main_loop.rs | 7 +++++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'crates') diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index dfd9eeeb4..02c7a1858 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs @@ -120,11 +120,6 @@ impl RawResponse { let error = RawResponseError { code, message, data: None }; RawResponse { id, result: None, error: Some(error) } } - /// Returns an "empty" RawResponse - /// Empty response still has a value `()` in its `result` field. - pub fn empty(id: u64) -> RawResponse { - RawResponse { id, result: Some(to_value(&()).unwrap()), error: None } - } } impl RawNotification { diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 1baeff266..ce50fb301 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -425,8 +425,11 @@ impl<'a> PoolDispatcher<'a> { // ErrorCode::ContentModified as i32, // "content modified".to_string(), // ) - RawResponse::empty(id) - + RawResponse { + id, + result: Some(serde_json::to_value(&()).unwrap()), + error: None, + } } else { RawResponse::err( id, -- cgit v1.2.3