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-lsp/src/lib.rs | |
parent | bd85460698c8d74f1a7b79c286a627c3ffcfb67e (diff) |
treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref
Diffstat (limited to 'helix-lsp/src/lib.rs')
-rw-r--r-- | helix-lsp/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index b0c84ff5..a51a11fc 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -30,12 +30,12 @@ pub mod util { use super::*; use helix_core::{RopeSlice, State, Transaction}; - pub fn lsp_pos_to_pos(doc: &RopeSlice, pos: lsp::Position) -> usize { + pub fn lsp_pos_to_pos(doc: RopeSlice, pos: lsp::Position) -> usize { let line = doc.line_to_char(pos.line as usize); let line_start = doc.char_to_utf16_cu(line); doc.utf16_cu_to_char(pos.character as usize + line_start) } - pub fn pos_to_lsp_pos(doc: &RopeSlice, pos: usize) -> lsp::Position { + pub fn pos_to_lsp_pos(doc: RopeSlice, pos: usize) -> lsp::Position { let line = doc.char_to_line(pos); let line_start = doc.char_to_utf16_cu(doc.line_to_char(line)); let col = doc.char_to_utf16_cu(pos) - line_start; @@ -58,8 +58,8 @@ pub mod util { None }; - let start = lsp_pos_to_pos(&doc, edit.range.start); - let end = lsp_pos_to_pos(&doc, edit.range.end); + let start = lsp_pos_to_pos(doc, edit.range.start); + let end = lsp_pos_to_pos(doc, edit.range.end); (start, end, replacement) }), ) |