1
Fork 0

7 - Make more use of let_chains

Continuation of #94376.

cc #53667
This commit is contained in:
Caio 2022-03-01 07:43:12 -03:00
parent 6e5a6ffb14
commit 7aa5ea9a4a
9 changed files with 100 additions and 112 deletions

View file

@ -724,12 +724,11 @@ impl<'tcx> Inliner<'tcx> {
caller_body: &mut Body<'tcx>,
) -> Local {
// Reuse the operand if it is a moved temporary.
if let Operand::Move(place) = &arg {
if let Some(local) = place.as_local() {
if caller_body.local_kind(local) == LocalKind::Temp {
return local;
}
}
if let Operand::Move(place) = &arg
&& let Some(local) = place.as_local()
&& caller_body.local_kind(local) == LocalKind::Temp
{
return local;
}
// Otherwise, create a temporary for the argument.