diff --git a/src/build/mod.rs b/src/build/mod.rs index 95de0afbb84..c500797acfd 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -399,11 +399,8 @@ impl BuildQueue { .spawn(move || { // window/progress notification that we are about to build notifier.notify_begin_progress(); - loop { - match progress_receiver.recv() { - Ok(progress) => notifier.notify_progress(progress), - Err(_) => break, // error means the sender was Dropped at build end - } + while let Ok(progress) = progress_receiver.recv() { + notifier.notify_progress(progress); } notifier.notify_end_progress(); }) diff --git a/src/build/rustc.rs b/src/build/rustc.rs index 394abd8508d..28e90d35d9b 100644 --- a/src/build/rustc.rs +++ b/src/build/rustc.rs @@ -135,7 +135,7 @@ impl RlsRustcCalls { fn new(analysis: Arc>>) -> RlsRustcCalls { RlsRustcCalls { default_calls: RustcDefaultCalls, - analysis: analysis, + analysis, } } } @@ -279,7 +279,7 @@ struct ReplacedFileLoader { impl ReplacedFileLoader { fn new(replacements: HashMap) -> ReplacedFileLoader { ReplacedFileLoader { - replacements: replacements, + replacements, real_file_loader: RealFileLoader, } } diff --git a/src/lsp_data.rs b/src/lsp_data.rs index 5222ae36ad1..eaf4110802b 100644 --- a/src/lsp_data.rs +++ b/src/lsp_data.rs @@ -359,7 +359,7 @@ impl notification::Notification for Progress { * to indicate progress. */ #[allow(non_upper_case_globals)] -pub const NOTIFICATION__Progress: &'static str = "window/progress"; +pub const NOTIFICATION__Progress: &str = "window/progress"; #[derive(Debug, PartialEq, Deserialize, Serialize, Clone)] pub struct ProgressParams { diff --git a/src/server/io.rs b/src/server/io.rs index a9b286f2264..fc9bc05a0a6 100644 --- a/src/server/io.rs +++ b/src/server/io.rs @@ -116,7 +116,7 @@ pub trait Output: Sync + Send + Clone + 'static { /// Notify the client of a failure with the given diagnostic message. fn failure_message>(&self, id: usize, code: jsonrpc::ErrorCode, msg: M) { let error = jsonrpc::Error { - code: code, + code, message: msg.into(), data: None, }; diff --git a/src/server/mod.rs b/src/server/mod.rs index 6234d25d050..426dba4d2bd 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -131,7 +131,7 @@ impl LsService { LsService { msg_reader: reader, - output: output, + output, ctx: ActionContext::new(analysis, vfs, config), dispatcher, }