on master help sign in
Address nightly clippy warnings
cad14c6Blaž Hrastnik
helix-lsp/src/lib.rs+1−1
@@ -326,7 +326,7 @@ impl ProgressStatus {
326 pub fn progress(&self) -> Option<&lsp::WorkDoneProgress> {
326 pub fn progress(&self) -> Option<&lsp::WorkDoneProgress> {
327 match &self {
327 match &self {
328 ProgressStatus::Created => None,
328 ProgressStatus::Created => None,
329− ProgressStatus::Started(progress) => Some(&progress),
329+ ProgressStatus::Started(progress) => Some(progress),
330 }
330 }
331 }
331 }
332}
332}
helix-term/src/args.rs+1−1
@@ -17,7 +17,7 @@ impl Args {
17
17
18 iter.next(); // skip the program, we don't care about that
18 iter.next(); // skip the program, we don't care about that
19
19
20− while let Some(arg) = iter.next() {
20+ for arg in &mut iter {
21 match arg.as_str() {
21 match arg.as_str() {
22 "--" => break, // stop parsing at this point treat the remaining as files
22 "--" => break, // stop parsing at this point treat the remaining as files
23 "--version" => args.display_version = true,
23 "--version" => args.display_version = true,
helix-term/src/ui/menu.rs+1−1
@@ -80,7 +80,7 @@ impl<T: Item> Menu<T> {
80 let text = option.filter_text();
80 let text = option.filter_text();
81 // TODO: using fuzzy_indices could give us the char idx for match highlighting
81 // TODO: using fuzzy_indices could give us the char idx for match highlighting
82 matcher
82 matcher
83− .fuzzy_match(&text, pattern)
83+ .fuzzy_match(text, pattern)
84 .map(|score| (index, score))
84 .map(|score| (index, score))
85 }),
85 }),
86 );
86 );
helix-term/src/ui/mod.rs+1−3
@@ -155,9 +155,7 @@ pub mod completers {
155 let mut matches: Vec<_> = names
155 let mut matches: Vec<_> = names
156 .into_iter()
156 .into_iter()
157 .filter_map(|(range, name)| {
157 .filter_map(|(range, name)| {
158− matcher
159− .fuzzy_match(&name, &input)
158+ matcher.fuzzy_match(&name, input).map(|score| (name, score))
160− .map(|score| (name, score))
161 })
159 })
162 .collect();
160 .collect();
163
161
helix-tui/src/widgets/table.rs+2−7
@@ -10,10 +10,7 @@ use cassowary::{
10 {Expression, Solver},
10 {Expression, Solver},
11};
11};
12use helix_view::graphics::{Rect, Style};
12use helix_view::graphics::{Rect, Style};
13−use std::{
14− collections::HashMap,
13+use std::collections::HashMap;
15− iter::{self, Iterator},
16−};
17use unicode_width::UnicodeWidthStr;
14use unicode_width::UnicodeWidthStr;
18
15
19/// A [`Cell`] contains the [`Text`] to be displayed in a [`Row`] of a [`Table`].
16/// A [`Cell`] contains the [`Text`] to be displayed in a [`Row`] of a [`Table`].
@@ -415,9 +412,7 @@ impl<'a> Table<'a> {
415 let has_selection = state.selected.is_some();
412 let has_selection = state.selected.is_some();
416 let columns_widths = self.get_columns_widths(table_area.width, has_selection);
413 let columns_widths = self.get_columns_widths(table_area.width, has_selection);
417 let highlight_symbol = self.highlight_symbol.unwrap_or("");
414 let highlight_symbol = self.highlight_symbol.unwrap_or("");
418− let blank_symbol = iter::repeat(" ")
415+ let blank_symbol = " ".repeat(highlight_symbol.width());
419− .take(highlight_symbol.width())
420− .collect::<String>();
421 let mut current_height = 0;
416 let mut current_height = 0;
422 let mut rows_height = table_area.height;
417 let mut rows_height = table_area.height;
423
418