From 6c705f09e88a4b63c4ed854bc9e956b0539ca8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sun, 9 May 2021 17:13:59 +0900 Subject: [PATCH] Lint --- helix-core/src/selection.rs | 4 ++-- helix-lsp/src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index dfd95bdd..67a20934 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -210,7 +210,7 @@ impl Selection { Self::single(pos, pos) } - fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Selection { + fn normalize(mut ranges: SmallVec<[Range; 1]>, mut primary_index: usize) -> Self { let primary = ranges[primary_index]; ranges.sort_unstable_by_key(Range::from); primary_index = ranges.iter().position(|&range| range == primary).unwrap(); @@ -249,7 +249,7 @@ impl Selection { result.push(range) } - Selection { + Self { ranges: result, primary_index, } diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 1bab2a17..1dbd6529 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -140,20 +140,20 @@ impl Notification { .expect("Failed to parse PublishDiagnostics params"); // TODO: need to loop over diagnostics and distinguish them by URI - Notification::PublishDiagnostics(params) + Self::PublishDiagnostics(params) } lsp::notification::ShowMessage::METHOD => { let params: lsp::ShowMessageParams = params.parse().expect("Failed to parse ShowMessage params"); - Notification::ShowMessage(params) + Self::ShowMessage(params) } lsp::notification::LogMessage::METHOD => { let params: lsp::LogMessageParams = params.parse().expect("Failed to parse ShowMessage params"); - Notification::LogMessage(params) + Self::LogMessage(params) } _ => { log::error!("unhandled LSP notification: {}", method);