on master help sign in
Fixes for new clippy lints in Rust 1.54.
3fda350Nathan Vegdahl
helix-core/src/comment.rs+1−1
@@ -72,7 +72,7 @@ pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&st
72 min_next_line = end + 1;
72 min_next_line = end + 1;
73 }
73 }
74
74
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);
76
76
77 let mut changes: Vec<Change> = Vec::with_capacity(to_change.len());
77 let mut changes: Vec<Change> = Vec::with_capacity(to_change.len());
78
78
helix-core/src/movement.rs+1
@@ -245,6 +245,7 @@ impl CharHelpers for Chars<'_> {
245
245
246 // Find our target position(s).
246 // Find our target position(s).
247 let head_start = head;
247 let head_start = head;
248+ #[allow(clippy::while_let_on_iterator)] // Clippy's suggestion to fix doesn't work here.
248 while let Some(next_ch) = self.next() {
249 while let Some(next_ch) = self.next() {
249 if prev_ch.is_none() || reached_target(target, prev_ch.unwrap(), next_ch) {
250 if prev_ch.is_none() || reached_target(target, prev_ch.unwrap(), next_ch) {
250 if head == head_start {
251 if head == head_start {
helix-term/src/commands.rs+1−1
@@ -1661,7 +1661,7 @@ mod cmd {
1661 Ok(contents) => {
1661 Ok(contents) => {
1662 let selection = doc.selection(view.id);
1662 let selection = doc.selection(view.id);
1663 let transaction =
1663 let transaction =
1664− Transaction::change_by_selection(doc.text(), &selection, |range| {
1664+ Transaction::change_by_selection(doc.text(), selection, |range| {
1665 (range.from(), range.to(), Some(contents.as_str().into()))
1665 (range.from(), range.to(), Some(contents.as_str().into()))
1666 });
1666 });
1667
1667
helix-term/src/keymap.rs+1−1
@@ -284,7 +284,7 @@ impl Deref for Keymap {
284 type Target = KeyTrieNode;
284 type Target = KeyTrieNode;
285
285
286 fn deref(&self) -> &Self::Target {
286 fn deref(&self) -> &Self::Target {
287− &self.root.node().unwrap()
287+ self.root.node().unwrap()
288 }
288 }
289}
289}
290
290