From 85ff328d31f4ccdbb797a3040f967963bfaa5fff Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 15 Oct 2018 22:36:08 +0300 Subject: remove clones --- crates/ra_lsp_server/src/main_loop/handlers.rs | 4 ++-- crates/ra_lsp_server/src/main_loop/mod.rs | 4 ++-- crates/ra_lsp_server/src/server_world.rs | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 1fe78f3d0..5acb39b60 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -478,7 +478,7 @@ pub fn handle_code_action( } pub fn publish_diagnostics( - world: ServerWorld, + world: &ServerWorld, file_id: FileId, ) -> Result { let uri = world.file_id_to_uri(file_id)?; @@ -497,7 +497,7 @@ pub fn publish_diagnostics( } pub fn publish_decorations( - world: ServerWorld, + world: &ServerWorld, file_id: FileId, ) -> Result { let uri = world.file_id_to_uri(file_id)?; diff --git a/crates/ra_lsp_server/src/main_loop/mod.rs b/crates/ra_lsp_server/src/main_loop/mod.rs index 773501efe..cf2477cb5 100644 --- a/crates/ra_lsp_server/src/main_loop/mod.rs +++ b/crates/ra_lsp_server/src/main_loop/mod.rs @@ -391,7 +391,7 @@ fn update_file_notifications_on_threadpool( ) { pool.spawn(move || { for file_id in subscriptions { - match handlers::publish_diagnostics(world.clone(), file_id) { + match handlers::publish_diagnostics(&world, file_id) { Err(e) => { error!("failed to compute diagnostics: {:?}", e) } @@ -400,7 +400,7 @@ fn update_file_notifications_on_threadpool( sender.send(Task::Notify(not)); } } - match handlers::publish_decorations(world.clone(), file_id) { + match handlers::publish_decorations(&world, file_id) { Err(e) => { error!("failed to compute decorations: {:?}", e) } diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs index c931afa02..9b3013ae8 100644 --- a/crates/ra_lsp_server/src/server_world.rs +++ b/crates/ra_lsp_server/src/server_world.rs @@ -23,7 +23,6 @@ pub struct ServerWorldState { pub mem_map: FxHashMap>, } -#[derive(Clone)] pub struct ServerWorld { pub workspaces: Arc>, pub analysis: Analysis, -- cgit v1.2.3