on master help sign in
Address nightly clippy warnings
commitcad14c6b46413b23d3afee7c979eeb0dbd4fb84c authorBlaž Hrastnik <blaz@mxxn.io> dateSun 27 Jun 2021, 13:27 (5 years ago) parented1a745
5 files changed+6−13
helix-lsp/src/lib.rs+1−1 helix-term/src/args.rs+1−1 helix-term/src/ui/menu.rs+1−1 helix-term/src/ui/mod.rs+1−3 helix-tui/src/widgets/table.rs+2−7
helix-lsp/src/lib.rs+1−1
@@ -326,7 +326,7 @@ impl ProgressStatus {
326326 pub fn progress(&self) -> Option<&lsp::WorkDoneProgress> {
327327 match &self {
328328 ProgressStatus::Created => None,
329− ProgressStatus::Started(progress) => Some(&progress),
329+ ProgressStatus::Started(progress) => Some(progress),
330330 }
331331 }
332332}
helix-term/src/args.rs+1−1
@@ -17,7 +17,7 @@ impl Args {
1717
1818 iter.next(); // skip the program, we don't care about that
1919
20− while let Some(arg) = iter.next() {
20+ for arg in &mut iter {
2121 match arg.as_str() {
2222 "--" => break, // stop parsing at this point treat the remaining as files
2323 "--version" => args.display_version = true,
helix-term/src/ui/menu.rs+1−1
@@ -80,7 +80,7 @@ impl<T: Item> Menu<T> {
8080 let text = option.filter_text();
8181 // TODO: using fuzzy_indices could give us the char idx for match highlighting
8282 matcher
83− .fuzzy_match(&text, pattern)
83+ .fuzzy_match(text, pattern)
8484 .map(|score| (index, score))
8585 }),
8686 );
helix-term/src/ui/mod.rs+1−3
@@ -155,9 +155,7 @@ pub mod completers {
155155 let mut matches: Vec<_> = names
156156 .into_iter()
157157 .filter_map(|(range, name)| {
158− matcher
159− .fuzzy_match(&name, &input)
160− .map(|score| (name, score))
158+ matcher.fuzzy_match(&name, input).map(|score| (name, score))
161159 })
162160 .collect();
163161
helix-tui/src/widgets/table.rs+2−7
@@ -10,10 +10,7 @@ use cassowary::{
1010 {Expression, Solver},
1111};
1212use helix_view::graphics::{Rect, Style};
13−use std::{
14− collections::HashMap,
15− iter::{self, Iterator},
16−};
13+use std::collections::HashMap;
1714use unicode_width::UnicodeWidthStr;
1815
1916/// A [`Cell`] contains the [`Text`] to be displayed in a [`Row`] of a [`Table`].
@@ -415,9 +412,7 @@ impl<'a> Table<'a> {
415412 let has_selection = state.selected.is_some();
416413 let columns_widths = self.get_columns_widths(table_area.width, has_selection);
417414 let highlight_symbol = self.highlight_symbol.unwrap_or("");
418− let blank_symbol = iter::repeat(" ")
419− .take(highlight_symbol.width())
420− .collect::<String>();
415+ let blank_symbol = " ".repeat(highlight_symbol.width());
421416 let mut current_height = 0;
422417 let mut rows_height = table_area.height;
423418