Skip to content

Commit 067bae3

Browse files
bors[bot]lnicola
andauthored
Merge #9927
9927: minor: Fix some clippy lints r=lnicola a=lnicola bors r+ Co-authored-by: Laurențiu Nicola <[email protected]>
2 parents 978b140 + c9f448a commit 067bae3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/hir/src/source_analyzer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl SourceAnalyzer {
129129
.and_then(|adjusts| adjusts.last().map(|adjust| adjust.target.clone()));
130130
let ty = infer[expr_id].clone();
131131
let mk_ty = |ty| Type::new_with_resolver(db, &self.resolver, ty);
132-
mk_ty(ty.clone()).zip(Some(coerced.and_then(mk_ty)))
132+
mk_ty(ty).zip(Some(coerced.and_then(mk_ty)))
133133
}
134134

135135
pub(crate) fn type_of_pat(
@@ -145,7 +145,7 @@ impl SourceAnalyzer {
145145
.and_then(|adjusts| adjusts.last().map(|adjust| adjust.target.clone()));
146146
let ty = infer[pat_id].clone();
147147
let mk_ty = |ty| Type::new_with_resolver(db, &self.resolver, ty);
148-
mk_ty(ty.clone()).zip(Some(coerced.and_then(mk_ty)))
148+
mk_ty(ty).zip(Some(coerced.and_then(mk_ty)))
149149
}
150150

151151
pub(crate) fn type_of_self(

crates/ide_assists/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ pub(crate) fn add_method_to_adt(
464464
}
465465

466466
pub fn useless_type_special_case(field_name: &str, field_ty: &String) -> Option<(String, String)> {
467-
if field_ty.to_string() == "String" {
467+
if field_ty == "String" {
468468
cov_mark::hit!(useless_type_special_case);
469469
return Some(("&str".to_string(), format!("self.{}.as_str()", field_name)));
470470
}

0 commit comments

Comments
 (0)