on master help sign in
Lint
6c705f0Blaž Hrastnik
helix-core/src/selection.rs+2−2
@@ -210,7 +210,7 @@ impl Selection {
210 Self::single(pos, pos)
210 Self::single(pos, pos)
211 }
211 }
212
212
213− fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Selection {
213+ fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Self {
214 let primary = ranges[primary_index];
214 let primary = ranges[primary_index];
215 ranges.sort_unstable_by_key(Range::from);
215 ranges.sort_unstable_by_key(Range::from);
216 primary_index = ranges.iter().position(|&range| range == primary).unwrap();
216 primary_index = ranges.iter().position(|&range| range == primary).unwrap();
@@ -249,7 +249,7 @@ impl Selection {
249 result.push(range)
249 result.push(range)
250 }
250 }
251
251
252− Selection {
252+ Self {
253 ranges: result,
253 ranges: result,
254 primary_index,
254 primary_index,
255 }
255 }
helix-lsp/src/lib.rs+3−3
@@ -140,20 +140,20 @@ impl Notification {
140 .expect("Failed to parse PublishDiagnostics params");
140 .expect("Failed to parse PublishDiagnostics params");
141
141
142 // TODO: need to loop over diagnostics and distinguish them by URI
142 // TODO: need to loop over diagnostics and distinguish them by URI
143− Notification::PublishDiagnostics(params)
143+ Self::PublishDiagnostics(params)
144 }
144 }
145
145
146 lsp::notification::ShowMessage::METHOD => {
146 lsp::notification::ShowMessage::METHOD => {
147 let params: lsp::ShowMessageParams =
147 let params: lsp::ShowMessageParams =
148 params.parse().expect("Failed to parse ShowMessage params");
148 params.parse().expect("Failed to parse ShowMessage params");
149
149
150− Notification::ShowMessage(params)
150+ Self::ShowMessage(params)
151 }
151 }
152 lsp::notification::LogMessage::METHOD => {
152 lsp::notification::LogMessage::METHOD => {
153 let params: lsp::LogMessageParams =
153 let params: lsp::LogMessageParams =
154 params.parse().expect("Failed to parse ShowMessage params");
154 params.parse().expect("Failed to parse ShowMessage params");
155
155
156− Notification::LogMessage(params)
156+ Self::LogMessage(params)
157 }
157 }
158 _ => {
158 _ => {
159 log::error!("unhandled LSP notification: {}", method);
159 log::error!("unhandled LSP notification: {}", method);