diff options
author | Nathan Vegdahl | 2021-07-01 19:55:18 +0000 |
---|---|---|
committer | Nathan Vegdahl | 2021-07-02 02:06:52 +0000 |
commit | 220bc85821d87f65630601dedd219fd2fa41c0ea (patch) | |
tree | 6500a0853a2ac7e95df0123e01f4f8ac582f2949 /helix-core/src/selection.rs | |
parent | b571f28641787ae4c5750e91899afdccc6d89ed6 (diff) |
Fix all remaining warnings in helix-core except for two.
I'm not sure how to address them, because they look like they
might be bugs, and code is involved. Will poke the relevant people.
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r-- | helix-core/src/selection.rs | 12 |
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] |