From c9dd1c930edee68a32ef19ee407820c247937b05 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 18 Feb 2021 18:34:22 +0900 Subject: treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref --- helix-view/src/view.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'helix-view') 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 { + pub fn screen_coords_at_pos(&self, text: RopeSlice, pos: usize) -> Option { 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(&self, text: &RopeSlice, start: usize, end: usize, fun: F) + // pub fn traverse(&self, text: RopeSlice, start: usize, end: usize, fun: F) // where // F: Fn(usize, usize), // { -- cgit v1.2.3-70-g09d2