fix some manual_map

This commit is contained in:
Matthias Krüger 2024-10-12 12:59:32 +02:00
parent dab76eccdf
commit 464f4057c2
2 changed files with 4 additions and 8 deletions

View File

@ -959,13 +959,9 @@ fn expected_fn_found_fn_mut_call(&self, err: &mut Diag<'_>, sp: Span, act: &str)
None
}
}
hir::ExprKind::MethodCall(_, _, args, span) => {
if let Some(def_id) = typeck_results.type_dependent_def_id(*hir_id) {
Some((def_id, *span, *args))
} else {
None
}
}
hir::ExprKind::MethodCall(_, _, args, span) => typeck_results
.type_dependent_def_id(*hir_id)
.map(|def_id| (def_id, *span, *args)),
_ => None,
}
};

View File

@ -537,7 +537,7 @@ fn visit_stmt(&mut self, ex: &'v hir::Stmt<'v>) -> Self::Result {
&& binding_id != self.binding_id
{
if self.check_and_add_sugg_binding(LetStmt {
ty_hir_id_opt: if let Some(ty) = ty { Some(ty.hir_id) } else { None },
ty_hir_id_opt: ty.map(|ty| ty.hir_id),
binding_id,
span: pat.span,
init_hir_id: init.hir_id,