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

@@ -38,16 +38,16 @@ pub fn main() void {
var count = 0;
count += 1;
var a1: [count]u8 = .{'A'} ** count;
const a1: [count]u8 = .{'A'} ** count;
count += 1;
var a2: [count]u8 = .{'B'} ** count;
const a2: [count]u8 = .{'B'} ** count;
count += 1;
var a3: [count]u8 = .{'C'} ** count;
const a3: [count]u8 = .{'C'} ** count;
count += 1;
var a4: [count]u8 = .{'D'} ** count;
const a4: [count]u8 = .{'D'} ** count;
print("{s} {s} {s} {s}\n", .{ a1, a2, a3, a4 });