From c9f448a8346dbe15f4feee75220b736f6ee17c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 16 Aug 2021 22:04:26 +0300 Subject: [PATCH] Fix some clippy lints --- crates/hir/src/source_analyzer.rs | 4 ++-- crates/ide_assists/src/utils.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index cb6fd69bc6..b6ee5968fa 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs @@ -129,7 +129,7 @@ impl SourceAnalyzer { .and_then(|adjusts| adjusts.last().map(|adjust| adjust.target.clone())); let ty = infer[expr_id].clone(); let mk_ty = |ty| Type::new_with_resolver(db, &self.resolver, ty); - mk_ty(ty.clone()).zip(Some(coerced.and_then(mk_ty))) + mk_ty(ty).zip(Some(coerced.and_then(mk_ty))) } pub(crate) fn type_of_pat( @@ -145,7 +145,7 @@ impl SourceAnalyzer { .and_then(|adjusts| adjusts.last().map(|adjust| adjust.target.clone())); let ty = infer[pat_id].clone(); let mk_ty = |ty| Type::new_with_resolver(db, &self.resolver, ty); - mk_ty(ty.clone()).zip(Some(coerced.and_then(mk_ty))) + mk_ty(ty).zip(Some(coerced.and_then(mk_ty))) } pub(crate) fn type_of_self( diff --git a/crates/ide_assists/src/utils.rs b/crates/ide_assists/src/utils.rs index 718fbeda8d..2431f5c4e7 100644 --- a/crates/ide_assists/src/utils.rs +++ b/crates/ide_assists/src/utils.rs @@ -464,7 +464,7 @@ pub(crate) fn add_method_to_adt( } pub fn useless_type_special_case(field_name: &str, field_ty: &String) -> Option<(String, String)> { - if field_ty.to_string() == "String" { + if field_ty == "String" { cov_mark::hit!(useless_type_special_case); return Some(("&str".to_string(), format!("self.{}.as_str()", field_name))); }