Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/lower.rs')
-rw-r--r--crates/hir-ty/src/mir/lower.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs
index d320dcdad2..99930798e8 100644
--- a/crates/hir-ty/src/mir/lower.rs
+++ b/crates/hir-ty/src/mir/lower.rs
@@ -288,12 +288,9 @@ impl<'ctx> MirLowerCtx<'ctx> {
current: BasicBlockId,
) -> Result<Option<(Operand, BasicBlockId)>> {
if !self.has_adjustments(expr_id) {
- match &self.body.exprs[expr_id] {
- Expr::Literal(l) => {
- let ty = self.expr_ty_without_adjust(expr_id);
- return Ok(Some((self.lower_literal_to_operand(ty, l)?, current)));
- }
- _ => (),
+ if let Expr::Literal(l) = &self.body.exprs[expr_id] {
+ let ty = self.expr_ty_without_adjust(expr_id);
+ return Ok(Some((self.lower_literal_to_operand(ty, l)?, current)));
}
}
let Some((p, current)) = self.lower_expr_as_place(current, expr_id, true)? else {