Removed varKind in favor of mutability

This commit is contained in:
2026-05-01 17:48:25 +02:00
parent b498cc7ff7
commit f9c9838e85
3 changed files with 7 additions and 24 deletions
+3 -6
View File
@@ -1,4 +1,4 @@
use parser::ast::{BinaryOp, Block, Expression, Postfix, Statement, TopLevel, TypeExpr, VarKind};
use parser::ast::{BinaryOp, Block, Expression, Postfix, Statement, TopLevel, TypeExpr};
pub struct RustCodegen {
output: String,
@@ -129,15 +129,12 @@ impl RustCodegen {
}
Statement::VarDecl {
kind,
mutable,
name,
init,
type_,
} => {
let mutability = match kind {
VarKind::Var => "mut ",
_ => "",
};
let mutability = if *mutable { "mut " } else { "" };
let ty = type_
.as_ref()