aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-02-18 09:34:22 +0000
committerBlaž Hrastnik2021-02-18 09:34:22 +0000
commitc9dd1c930edee68a32ef19ee407820c247937b05 (patch)
tree667de4906e291df3b1dc1e6f71460415e4eb2501 /helix-view
parentbd85460698c8d74f1a7b79c286a627c3ffcfb67e (diff)
treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/view.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index f1959ee3..1623dfc4 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -61,7 +61,7 @@ impl View {
/// Translates a document position to an absolute position in the terminal.
/// Returns a (line, col) position if the position is visible on screen.
// TODO: Could return width as well for the character width at cursor.
- pub fn screen_coords_at_pos(&self, text: &RopeSlice, pos: usize) -> Option<Position> {
+ pub fn screen_coords_at_pos(&self, text: RopeSlice, pos: usize) -> Option<Position> {
let line = text.char_to_line(pos);
if line < self.first_line as usize || line > self.last_line() {
@@ -73,7 +73,7 @@ impl View {
let line_slice = text.slice(line_start..pos);
let mut col = 0;
- for grapheme in RopeGraphemes::new(&line_slice) {
+ for grapheme in RopeGraphemes::new(line_slice) {
if grapheme == "\t" {
col += TAB_WIDTH;
} else {
@@ -87,7 +87,7 @@ impl View {
Some(Position::new(row, col))
}
- // pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
+ // pub fn traverse<F>(&self, text: RopeSlice, start: usize, end: usize, fun: F)
// where
// F: Fn(usize, usize),
// {