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_ssr/src/matching.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide_ssr/src/matching.rs') diff --git a/crates/ide_ssr/src/matching.rs b/crates/ide_ssr/src/matching.rs index b3072fb9f..fb92a0ccc 100644 --- a/crates/ide_ssr/src/matching.rs +++ b/crates/ide_ssr/src/matching.rs @@ -382,7 +382,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> { code: Option, ) -> Result<(), MatchFailed> { match (pattern, code) { - (Some(p), Some(c)) => self.attempt_match_node(phase, &p.syntax(), &c.syntax()), + (Some(p), Some(c)) => self.attempt_match_node(phase, p.syntax(), c.syntax()), (None, None) => Ok(()), (Some(p), None) => fail_match!("Pattern `{}` had nothing to match", p.syntax().text()), (None, Some(c)) => { @@ -478,7 +478,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> { if Some(first_token.text()) == next_pattern_token.as_deref() { if let Some(SyntaxElement::Node(p)) = pattern.next() { // We have a subtree that starts with the next token in our pattern. - self.attempt_match_token_tree(phase, &p, &n)?; + self.attempt_match_token_tree(phase, &p, n)?; break; } } @@ -609,7 +609,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> { expr: &ast::Expr, ) -> Result { use hir::HirDisplay; - let code_type = self.sema.type_of_expr(&expr).ok_or_else(|| { + let code_type = self.sema.type_of_expr(expr).ok_or_else(|| { match_error!("Failed to get receiver type for `{}`", expr.syntax().text()) })?; // Temporary needed to make the borrow checker happy. -- cgit v1.2.3