mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #9927
9927: minor: Fix some clippy lints r=lnicola a=lnicola bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
067bae3247
2 changed files with 3 additions and 3 deletions
|
@ -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(
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue