Skip to content

Commit 67f7b70

Browse files
committed
Apply clippy lints on textobject
1 parent 94e2f3b commit 67f7b70

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

helix-core/src/textobject.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
use ropey::{Rope, RopeSlice};
1+
use ropey::RopeSlice;
22

33
use crate::chars::{categorize_char, char_is_line_ending, char_is_whitespace, CharCategory};
44
use crate::movement::{self, Direction};
55
use crate::surround;
66
use crate::Range;
77

8-
fn this_word_end_pos(slice: RopeSlice, mut pos: usize) -> usize {
8+
fn this_word_end_pos(slice: RopeSlice, pos: usize) -> usize {
99
this_word_bound_pos(slice, pos, Direction::Forward)
1010
}
1111

12-
fn this_word_start_pos(slice: RopeSlice, mut pos: usize) -> usize {
12+
fn this_word_start_pos(slice: RopeSlice, pos: usize) -> usize {
1313
this_word_bound_pos(slice, pos, Direction::Backward)
1414
}
1515

@@ -97,15 +97,6 @@ pub fn textobject_word(
9797
Range::new(anchor, head)
9898
}
9999

100-
pub fn textobject_paragraph(
101-
slice: RopeSlice,
102-
range: Range,
103-
textobject: TextObject,
104-
count: usize,
105-
) -> Range {
106-
Range::point(0)
107-
}
108-
109100
pub fn textobject_surround(
110101
slice: RopeSlice,
111102
range: Range,

helix-term/src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3507,7 +3507,7 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
35073507
let (view, doc) = current!(cx.editor);
35083508
let text = doc.text().slice(..);
35093509

3510-
let selection = doc.selection(view.id).transform(|mut range| {
3510+
let selection = doc.selection(view.id).transform(|range| {
35113511
match ch {
35123512
'w' => textobject::textobject_word(text, range, objtype, count),
35133513
// TODO: cancel new ranges if inconsistent surround matches across lines

0 commit comments

Comments
 (0)