aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/selection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r--helix-core/src/selection.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs
index ff5dc23d..d99e2aff 100644
--- a/helix-core/src/selection.rs
+++ b/helix-core/src/selection.rs
@@ -345,10 +345,8 @@ pub fn select_on_matches(
// TODO: can't avoid occasional allocations since Regex can't operate on chunks yet
let fragment = sel.fragment(text);
- let mut sel_start = sel.from();
- let sel_end = sel.to();
-
- let mut start_byte = text.char_to_byte(sel_start);
+ let sel_start = sel.from();
+ let start_byte = text.char_to_byte(sel_start);
for mat in regex.find_iter(&fragment) {
// TODO: retain range direction
@@ -379,10 +377,10 @@ pub fn split_on_matches(
// TODO: can't avoid occasional allocations since Regex can't operate on chunks yet
let fragment = sel.fragment(text);
- let mut sel_start = sel.from();
+ let sel_start = sel.from();
let sel_end = sel.to();
- let mut start_byte = text.char_to_byte(sel_start);
+ let start_byte = text.char_to_byte(sel_start);
let mut start = sel_start;
@@ -411,7 +409,7 @@ mod test {
#[test]
#[should_panic]
fn test_new_empty() {
- let sel = Selection::new(smallvec![], 0);
+ let _ = Selection::new(smallvec![], 0);
}
#[test]