From 1329dd4e287c137ec0a90abeec0272275b2b2c8d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 2 Sep 2018 15:18:43 +0300 Subject: Avoid clones --- crates/server/src/main_loop/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/server/src/main_loop') diff --git a/crates/server/src/main_loop/mod.rs b/crates/server/src/main_loop/mod.rs index 52fc00c9c..bb1d638e0 100644 --- a/crates/server/src/main_loop/mod.rs +++ b/crates/server/src/main_loop/mod.rs @@ -130,7 +130,7 @@ fn main_loop_inner( Event::Ws(ws) => { match ws { Ok(ws) => { - let not = RawNotification::new::(vec![ws.clone()]); + let not = RawNotification::new::(&vec![ws.clone()]); msg_sender.send(RawMessage::Notification(not)); state.set_workspaces(vec![ws]); state_changed = true; @@ -288,7 +288,7 @@ fn on_notification( let file_id = state.remove_mem_file(path.as_path())?; subs.remove_sub(file_id); let params = req::PublishDiagnosticsParams { uri, diagnostics: Vec::new() }; - let not = RawNotification::new::(params); + let not = RawNotification::new::(¶ms); msg_sender.send(RawMessage::Notification(not)); return Ok(()) } @@ -326,7 +326,7 @@ impl<'a> PoolDispatcher<'a> { let sender = self.sender.clone(); self.pool.execute(move || { let resp = match f(world, params, token) { - Ok(resp) => RawResponse::ok::(id, resp), + Ok(resp) => RawResponse::ok::(id, &resp), Err(e) => RawResponse::err(id, ErrorCode::InternalError as i32, e.to_string()), }; let task = Task::Respond(resp); @@ -363,7 +363,7 @@ fn update_file_notifications_on_threadpool( error!("failed to compute diagnostics: {:?}", e) } Ok(params) => { - let not = RawNotification::new::(params); + let not = RawNotification::new::(¶ms); sender.send(Task::Notify(not)); } } @@ -372,7 +372,7 @@ fn update_file_notifications_on_threadpool( error!("failed to compute decorations: {:?}", e) } Ok(params) => { - let not = RawNotification::new::(params); + let not = RawNotification::new::(¶ms); sender.send(Task::Notify(not)) } } -- cgit v1.2.3