mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 13:37:06 +04:00
Fixes for new clippy lints in Rust 1.54.
This commit is contained in:
parent
05d20e196f
commit
3fda350494
@ -72,7 +72,7 @@ pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&st
|
|||||||
min_next_line = end + 1;
|
min_next_line = end + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let (commented, to_change, min, margin) = find_line_comment(&token, text, lines);
|
let (commented, to_change, min, margin) = find_line_comment(token, text, lines);
|
||||||
|
|
||||||
let mut changes: Vec<Change> = Vec::with_capacity(to_change.len());
|
let mut changes: Vec<Change> = Vec::with_capacity(to_change.len());
|
||||||
|
|
||||||
|
@ -245,6 +245,7 @@ fn range_to_target(&mut self, target: WordMotionTarget, origin: Range) -> Range
|
|||||||
|
|
||||||
// Find our target position(s).
|
// Find our target position(s).
|
||||||
let head_start = head;
|
let head_start = head;
|
||||||
|
#[allow(clippy::while_let_on_iterator)] // Clippy's suggestion to fix doesn't work here.
|
||||||
while let Some(next_ch) = self.next() {
|
while let Some(next_ch) = self.next() {
|
||||||
if prev_ch.is_none() || reached_target(target, prev_ch.unwrap(), next_ch) {
|
if prev_ch.is_none() || reached_target(target, prev_ch.unwrap(), next_ch) {
|
||||||
if head == head_start {
|
if head == head_start {
|
||||||
|
@ -1661,7 +1661,7 @@ fn replace_selections_with_clipboard(
|
|||||||
Ok(contents) => {
|
Ok(contents) => {
|
||||||
let selection = doc.selection(view.id);
|
let selection = doc.selection(view.id);
|
||||||
let transaction =
|
let transaction =
|
||||||
Transaction::change_by_selection(doc.text(), &selection, |range| {
|
Transaction::change_by_selection(doc.text(), selection, |range| {
|
||||||
(range.from(), range.to(), Some(contents.as_str().into()))
|
(range.from(), range.to(), Some(contents.as_str().into()))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ impl Deref for Keymap {
|
|||||||
type Target = KeyTrieNode;
|
type Target = KeyTrieNode;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
&self.root.node().unwrap()
|
self.root.node().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user