Adopt let else in more places

This commit is contained in:
est31
2022-02-19 00:48:49 +01:00
parent b8c56fa8c3
commit 2ef8af6619
132 changed files with 539 additions and 881 deletions

View File

@@ -861,11 +861,10 @@ fn foo(&self) -> Self::T { String::new() }
body_owner_def_id: DefId,
found: Ty<'tcx>,
) -> bool {
let hir_id =
match body_owner_def_id.as_local().map(|id| self.hir().local_def_id_to_hir_id(id)) {
Some(hir_id) => hir_id,
None => return false,
};
let Some(hir_id) = body_owner_def_id.as_local() else {
return false;
};
let hir_id = self.hir().local_def_id_to_hir_id(hir_id);
// When `body_owner` is an `impl` or `trait` item, look in its associated types for
// `expected` and point at it.
let parent_id = self.hir().get_parent_item(hir_id);