From 63399eccfa1d7de4248f9f0d8f790a97769d9a0e Mon Sep 17 00:00:00 2001 From: Jaromir Obr Date: Wed, 30 Mar 2022 20:25:45 +0200 Subject: [PATCH] Removed passing of references to objects which are already references --- src/document.rs | 4 ++-- src/editor.rs | 2 +- src/row.rs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/document.rs b/src/document.rs index f9dafb3..20aac3f 100644 --- a/src/document.rs +++ b/src/document.rs @@ -130,7 +130,7 @@ impl Document { }; for _ in start..end { if let Some(row) = self.rows.get(position.y) { - if let Some(x) = row.find(&query, position.x, direction) { + if let Some(x) = row.find(query, position.x, direction) { position.x = x; return Some(position); } @@ -161,7 +161,7 @@ impl Document { #[allow(clippy::indexing_slicing)] for row in &mut self.rows[..until] { start_with_comment = row.highlight( - &self.file_type.highlighting_options(), + self.file_type.highlighting_options(), word, start_with_comment, ); diff --git a/src/editor.rs b/src/editor.rs index af10def..42c1fb8 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -153,7 +153,7 @@ impl Editor { if let Some(position) = editor .document - .find(&query, &editor.cursor_position, direction) + .find(query, &editor.cursor_position, direction) { editor.cursor_position = position; editor.scroll(); diff --git a/src/row.rs b/src/row.rs index 0564d13..83bcc43 100644 --- a/src/row.rs +++ b/src/row.rs @@ -238,7 +238,7 @@ impl Row { } } - if self.highlight_str(index, &word, chars, hl_type) { + if self.highlight_str(index, word, chars, hl_type) { return true; } } @@ -437,15 +437,15 @@ impl Row { index = closing_index; } while let Some(c) = chars.get(index) { - if self.highlight_multiline_comment(&mut index, &opts, *c, &chars) { + if self.highlight_multiline_comment(&mut index, opts, *c, &chars) { in_ml_comment = true; continue; } in_ml_comment = false; if self.highlight_char(&mut index, opts, *c, &chars) || self.highlight_comment(&mut index, opts, *c, &chars) - || self.highlight_primary_keywords(&mut index, &opts, &chars) - || self.highlight_secondary_keywords(&mut index, &opts, &chars) + || self.highlight_primary_keywords(&mut index, opts, &chars) + || self.highlight_secondary_keywords(&mut index, opts, &chars) || self.highlight_string(&mut index, opts, *c, &chars) || self.highlight_number(&mut index, opts, *c, &chars) {