From de7b2482274df76d3acece3cc8c1388a77e76e09 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 26 Jun 2020 17:17:38 +0200 Subject: Minor --- crates/rust-analyzer/src/global_state.rs | 5 ++--- crates/rust-analyzer/src/lsp_utils.rs | 9 --------- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 3c9752259..29601d13e 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -12,13 +12,13 @@ use parking_lot::RwLock; use ra_db::{CrateId, VfsPath}; use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; +use rustc_hash::{FxHashMap, FxHashSet}; use crate::{ config::Config, diagnostics::{CheckFixes, DiagnosticCollection}, from_proto, line_endings::LineEndings, - lsp_utils::notification_new, main_loop::Task, reload::SourceRootConfig, request_metrics::{LatestRequests, RequestMetrics}, @@ -26,7 +26,6 @@ use crate::{ to_proto::url_from_abs_path, Result, }; -use rustc_hash::{FxHashMap, FxHashSet}; #[derive(Eq, PartialEq)] pub(crate) enum Status { @@ -190,7 +189,7 @@ impl GlobalState { &mut self, params: N::Params, ) { - let not = notification_new::(params); + let not = lsp_server::Notification::new(N::METHOD.to_string(), params); self.send(not.into()); } diff --git a/crates/rust-analyzer/src/lsp_utils.rs b/crates/rust-analyzer/src/lsp_utils.rs index 99f4998a9..0bc3ff115 100644 --- a/crates/rust-analyzer/src/lsp_utils.rs +++ b/crates/rust-analyzer/src/lsp_utils.rs @@ -4,7 +4,6 @@ use std::{error::Error, ops::Range}; use lsp_server::Notification; use ra_db::Canceled; use ra_ide::LineIndex; -use serde::Serialize; use crate::{from_proto, global_state::GlobalState}; @@ -18,14 +17,6 @@ pub(crate) fn notification_is( notification.method == N::METHOD } -pub(crate) fn notification_new(params: N::Params) -> Notification -where - N: lsp_types::notification::Notification, - N::Params: Serialize, -{ - Notification::new(N::METHOD.to_string(), params) -} - #[derive(Debug, Eq, PartialEq)] pub(crate) enum Progress { Begin, -- cgit v1.2.3