Fixes for new clippy lints in Rust 1.54.
commit3fda350494449bf5909a0b47f9e2f593fbe615ad
authorNathan Vegdahl <cessen@cessen.com>
dateThu 29 Jul 2021, 12:41 (5 years ago)
parent05d20e1
helix-core/src/comment.rs+1−1
@@ -72,7 +72,7 @@ pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&st
7272 min_next_line = end + 1;
7373 }
7474
75− let (commented, to_change, min, margin) = find_line_comment(&token, text, lines);
75+ let (commented, to_change, min, margin) = find_line_comment(token, text, lines);
7676
7777 let mut changes: Vec<Change> = Vec::with_capacity(to_change.len());
7878
helix-core/src/movement.rs+1
@@ -245,6 +245,7 @@ impl CharHelpers for Chars<'_> {
245245
246246 // Find our target position(s).
247247 let head_start = head;
248+ #[allow(clippy::while_let_on_iterator)] // Clippy's suggestion to fix doesn't work here.
248249 while let Some(next_ch) = self.next() {
249250 if prev_ch.is_none() || reached_target(target, prev_ch.unwrap(), next_ch) {
250251 if head == head_start {
helix-term/src/commands.rs+1−1
@@ -1661,7 +1661,7 @@ mod cmd {
16611661 Ok(contents) => {
16621662 let selection = doc.selection(view.id);
16631663 let transaction =
1664− Transaction::change_by_selection(doc.text(), &selection, |range| {
1664+ Transaction::change_by_selection(doc.text(), selection, |range| {
16651665 (range.from(), range.to(), Some(contents.as_str().into()))
16661666 });
16671667
helix-term/src/keymap.rs+1−1
@@ -284,7 +284,7 @@ impl Deref for Keymap {
284284 type Target = KeyTrieNode;
285285
286286 fn deref(&self) -> &Self::Target {
287− &self.root.node().unwrap()
287+ self.root.node().unwrap()
288288 }
289289}
290290