diff options
author | Blaž Hrastnik | 2021-02-18 09:34:22 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-02-18 09:34:22 +0000 |
commit | c9dd1c930edee68a32ef19ee407820c247937b05 (patch) | |
tree | 667de4906e291df3b1dc1e6f71460415e4eb2501 /helix-term/src/ui | |
parent | bd85460698c8d74f1a7b79c286a627c3ffcfb67e (diff) |
treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 22e80623..7d812116 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -134,7 +134,7 @@ impl EditorView { let mut char_index = start; // iterate over range char by char - for grapheme in RopeGraphemes::new(&text) { + for grapheme in RopeGraphemes::new(text) { // TODO: track current char_index if grapheme == "\n" { @@ -211,8 +211,8 @@ impl EditorView { .filter(|range| range.overlaps(&screen)) { // TODO: render also if only one of the ranges is in viewport - let mut start = view.screen_coords_at_pos(&text, selection.anchor); - let mut end = view.screen_coords_at_pos(&text, selection.head); + let mut start = view.screen_coords_at_pos(text, selection.anchor); + let mut end = view.screen_coords_at_pos(text, selection.head); // cursor if let Some(end) = end { @@ -439,7 +439,7 @@ impl Component for EditorView { let cursor = view.doc.state.selection().cursor(); let mut pos = view - .screen_coords_at_pos(&view.doc.text().slice(..), cursor) + .screen_coords_at_pos(view.doc.text().slice(..), cursor) .expect("Cursor is out of bounds."); pos.col += view.area.x as usize + area.x as usize + OFFSET as usize; pos.row += view.area.y as usize + area.y as usize; |