Converted var to const if there is no mutation in var.

This is checked from compiler version 0.12.0-dev.1664
This commit is contained in:
Chris Boesch
2023-11-21 15:01:22 +01:00
parent b7015c2d9d
commit 7679f93f68
21 changed files with 46 additions and 46 deletions

View File

@@ -21,8 +21,8 @@ const MyErr = error{ GetFail, IncFail };
pub fn main() void {
// We simply quit the entire program if we fail to get a number:
var a: u32 = makeNumber() catch return;
var b: u32 = makeNumber() catch return;
const a: u32 = makeNumber() catch return;
const b: u32 = makeNumber() catch return;
std.debug.print("Numbers: {}, {}\n", .{ a, b });
}