Skip to content

Commit 2ef8af6

Browse files
committedFeb 19, 2022
Adopt let else in more places
·
1.88.01.61.0
1 parent b8c56fa commit 2ef8af6

File tree

132 files changed

+539
-881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+539
-881
lines changed
 

‎compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
338338

339339
let idx2 = *o.get();
340340
let &(ref op2, op_sp2) = &operands[idx2];
341-
let reg2 = match op2.reg() {
342-
Some(asm::InlineAsmRegOrRegClass::Reg(r)) => r,
343-
_ => unreachable!(),
341+
let Some(asm::InlineAsmRegOrRegClass::Reg(reg2)) = op2.reg() else {
342+
unreachable!();
344343
};
345344

346345
let msg = format!(

‎compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
326326
args: Vec<AstP<Expr>>,
327327
legacy_args_idx: &[usize],
328328
) -> hir::ExprKind<'hir> {
329-
let path = match f.kind {
330-
ExprKind::Path(None, ref mut path) => path,
331-
_ => unreachable!(),
329+
let ExprKind::Path(None, ref mut path) = f.kind else {
330+
unreachable!();
332331
};
333332

334333
// Split the arguments into const generics and normal arguments

0 commit comments

Comments
 (0)
Please sign in to comment.