Skip to content

Commit 464f405

Browse files
committed
fix some manual_map
1 parent dab76ec commit 464f405

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -959,13 +959,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
959959
None
960960
}
961961
}
962-
hir::ExprKind::MethodCall(_, _, args, span) => {
963-
if let Some(def_id) = typeck_results.type_dependent_def_id(*hir_id) {
964-
Some((def_id, *span, *args))
965-
} else {
966-
None
967-
}
968-
}
962+
hir::ExprKind::MethodCall(_, _, args, span) => typeck_results
963+
.type_dependent_def_id(*hir_id)
964+
.map(|def_id| (def_id, *span, *args)),
969965
_ => None,
970966
}
971967
};

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
537537
&& binding_id != self.binding_id
538538
{
539539
if self.check_and_add_sugg_binding(LetStmt {
540-
ty_hir_id_opt: if let Some(ty) = ty { Some(ty.hir_id) } else { None },
540+
ty_hir_id_opt: ty.map(|ty| ty.hir_id),
541541
binding_id,
542542
span: pat.span,
543543
init_hir_id: init.hir_id,

0 commit comments

Comments
 (0)