Skip to content

Commit 6c27402

Browse files
coding with no rust analyzer is hard
1 parent 54c2d27 commit 6c27402

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/interpreter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn eval_expr<'a>(expr: &Expr<'a>, env: &Env<'a>) -> Result<f64, EvalError> {
8787
eval_stmt(stmt, &mut inner_env)?;
8888
}
8989

90-
tail_expr.map(|expr| eval_expr(expr, &inner_env)).unwrap_or(Ok(0.0))
90+
tail_expr.as_ref().map(|expr| eval_expr(expr, &inner_env)).unwrap_or(Ok(0.0))
9191
}
9292

9393
ExprKind::Error => Err(EvalError::InvalidExpression(expr.span)),

src/ir/lowerer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl FunctionIRBuilder<'_> {
130130
}
131131
t::ExprKind::Block { stmts, tail_expr } => {
132132
for stmt in stmts {
133-
self.lower_stmt();
133+
self.lower_stmt(stmt);
134134
}
135135

136136
match tail_expr {

src/semantics/typechecker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl TypeChecker<'_> {
108108

109109
let typed_expr = tail_expr.map(|expr| Box::new(self.infer(*expr)));
110110

111-
let ty = typed_expr.map(|e| e.ty.clone()).unwrap_or(Type::Unit);
111+
let ty = typed_expr.as_ref().map(|e| e.ty.clone()).unwrap_or(Type::Unit);
112112

113113
t::Expr {
114114
kind: t::ExprKind::Block {

0 commit comments

Comments
 (0)