From c9b4ac5be4daaabc062ab1ee663eba8594750003 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:24:16 +0530 Subject: clippy::redudant_borrow --- crates/ide/src/typing/on_enter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide/src/typing/on_enter.rs') diff --git a/crates/ide/src/typing/on_enter.rs b/crates/ide/src/typing/on_enter.rs index 81c4d95b1..5cba9d11d 100644 --- a/crates/ide/src/typing/on_enter.rs +++ b/crates/ide/src/typing/on_enter.rs @@ -88,12 +88,12 @@ fn on_enter_in_comment( if comment.text().ends_with(' ') { cov_mark::hit!(continues_end_of_line_comment_with_space); remove_trailing_whitespace = true; - } else if !followed_by_comment(&comment) { + } else if !followed_by_comment(comment) { return None; } } - let indent = node_indent(&file, comment.syntax())?; + let indent = node_indent(file, comment.syntax())?; let inserted = format!("\n{}{} $0", indent, prefix); let delete = if remove_trailing_whitespace { let trimmed_len = comment.text().trim_end().len() as u32; @@ -188,7 +188,7 @@ mod tests { use crate::fixture; fn apply_on_enter(before: &str) -> Option { - let (analysis, position) = fixture::position(&before); + let (analysis, position) = fixture::position(before); let result = analysis.on_enter(position).unwrap()?; let mut actual = analysis.file_text(position.file_id).unwrap().to_string(); -- cgit v1.2.3