Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 22254c4

Browse files
authored
Merge pull request #763 from BORN2LOSE/field_names
Changing field names
2 parents 5c5e479 + 3b0b225 commit 22254c4

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

src/build/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,8 @@ impl BuildQueue {
399399
.spawn(move || {
400400
// window/progress notification that we are about to build
401401
notifier.notify_begin_progress();
402-
loop {
403-
match progress_receiver.recv() {
404-
Ok(progress) => notifier.notify_progress(progress),
405-
Err(_) => break, // error means the sender was Dropped at build end
406-
}
402+
while let Ok(progress) = progress_receiver.recv() {
403+
notifier.notify_progress(progress);
407404
}
408405
notifier.notify_end_progress();
409406
})

src/build/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl RlsRustcCalls {
135135
fn new(analysis: Arc<Mutex<Option<Analysis>>>) -> RlsRustcCalls {
136136
RlsRustcCalls {
137137
default_calls: RustcDefaultCalls,
138-
analysis: analysis,
138+
analysis,
139139
}
140140
}
141141
}
@@ -279,7 +279,7 @@ struct ReplacedFileLoader {
279279
impl ReplacedFileLoader {
280280
fn new(replacements: HashMap<PathBuf, String>) -> ReplacedFileLoader {
281281
ReplacedFileLoader {
282-
replacements: replacements,
282+
replacements,
283283
real_file_loader: RealFileLoader,
284284
}
285285
}

src/lsp_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl notification::Notification for Progress {
359359
* to indicate progress.
360360
*/
361361
#[allow(non_upper_case_globals)]
362-
pub const NOTIFICATION__Progress: &'static str = "window/progress";
362+
pub const NOTIFICATION__Progress: &str = "window/progress";
363363

364364
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone)]
365365
pub struct ProgressParams {

src/server/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub trait Output: Sync + Send + Clone + 'static {
116116
/// Notify the client of a failure with the given diagnostic message.
117117
fn failure_message<M: Into<String>>(&self, id: usize, code: jsonrpc::ErrorCode, msg: M) {
118118
let error = jsonrpc::Error {
119-
code: code,
119+
code,
120120
message: msg.into(),
121121
data: None,
122122
};

src/server/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<O: Output> LsService<O> {
131131

132132
LsService {
133133
msg_reader: reader,
134-
output: output,
134+
output,
135135
ctx: ActionContext::new(analysis, vfs, config),
136136
dispatcher,
137137
}

0 commit comments

Comments
 (0)