use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
This commit is contained in:
@@ -832,14 +832,11 @@ fn foo(&self) -> Self::T { String::new() }
|
||||
kind: hir::ItemKind::Impl { items, .. }, ..
|
||||
})) => {
|
||||
for item in &items[..] {
|
||||
match item.kind {
|
||||
hir::AssocItemKind::Type => {
|
||||
if self.type_of(self.hir().local_def_id(item.id.hir_id)) == found {
|
||||
db.span_label(item.span, "expected this associated type");
|
||||
return true;
|
||||
}
|
||||
if let hir::AssocItemKind::Type = item.kind {
|
||||
if self.type_of(self.hir().local_def_id(item.id.hir_id)) == found {
|
||||
db.span_label(item.span, "expected this associated type");
|
||||
return true;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user