1
Fork 0

Use let_else in some more places in rustc_lint

This commit is contained in:
est31 2021-12-03 03:25:11 +01:00
parent ff23ad3179
commit bdc4b46221
6 changed files with 52 additions and 69 deletions

View file

@ -79,9 +79,8 @@ impl<'tcx> LateLintPass<'tcx> for ArrayIntoIter {
let receiver_ty = cx.typeck_results().expr_ty(receiver_arg);
let adjustments = cx.typeck_results().expr_adjustments(receiver_arg);
let target = match adjustments.last() {
Some(Adjustment { kind: Adjust::Borrow(_), target }) => target,
_ => return,
let Some(Adjustment { kind: Adjust::Borrow(_), target }) = adjustments.last() else {
return
};
let types =