aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-09-29 09:02:27 +0000
committerBlaž Hrastnik2020-09-29 09:07:05 +0000
commit3feb00283df92b8865c9cf7baba0e2ab06dcc028 (patch)
treec174b36de7866b7710a7f29cca95d9f6be66dcaa /helix-view/src/commands.rs
parent1bb01d27aed8b046ff1cb41d4932c303d3b4ad0d (diff)
clippy warnings
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r--helix-view/src/commands.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs
index d611e4f6..bdfa57ec 100644
--- a/helix-view/src/commands.rs
+++ b/helix-view/src/commands.rs
@@ -42,7 +42,7 @@ pub fn move_line_down(view: &mut View, count: usize) {
.move_selection(Direction::Forward, Granularity::Line, count);
}
-pub fn move_line_end(view: &mut View, count: usize) {
+pub fn move_line_end(view: &mut View, _count: usize) {
// TODO: use a transaction
let lines = selection_lines(&view.state);
@@ -64,7 +64,7 @@ pub fn move_line_end(view: &mut View, count: usize) {
transaction.apply(&mut view.state);
}
-pub fn move_line_start(view: &mut View, count: usize) {
+pub fn move_line_start(view: &mut View, _count: usize) {
let lines = selection_lines(&view.state);
let positions = lines
@@ -208,24 +208,24 @@ fn selection_lines(state: &State) -> Vec<usize> {
.map(|range| state.doc.char_to_line(range.head))
.collect::<Vec<_>>();
- lines.sort();
+ lines.sort_unstable(); // sorting by usize so _unstable is preferred
lines.dedup();
lines
}
// I inserts at the start of each line with a selection
-pub fn prepend_to_line(view: &mut View, _count: usize) {
+pub fn prepend_to_line(view: &mut View, count: usize) {
view.state.mode = Mode::Insert;
- move_line_start(view, _count);
+ move_line_start(view, count);
}
// A inserts at the end of each line with a selection
-pub fn append_to_line(view: &mut View, _count: usize) {
+pub fn append_to_line(view: &mut View, count: usize) {
view.state.mode = Mode::Insert;
- move_line_end(view, _count);
+ move_line_end(view, count);
}
// o inserts a new line after each line with a selection