From 669d4f7337d43628fd031888d9dc46d22289fcdf Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Sun, 26 Dec 2021 13:24:01 +0900 Subject: use const for variables that are never modified --- exercises/033_iferror.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'exercises/033_iferror.zig') diff --git a/exercises/033_iferror.zig b/exercises/033_iferror.zig index f281b8d..6ba0c61 100644 --- a/exercises/033_iferror.zig +++ b/exercises/033_iferror.zig @@ -29,12 +29,12 @@ const MyNumberError = error{ const std = @import("std"); pub fn main() void { - var nums = [_]u8{ 2, 3, 4, 5, 6 }; + const nums = [_]u8{ 2, 3, 4, 5, 6 }; for (nums) |num| { std.debug.print("{}", .{num}); - var n = numberMaybeFail(num); + const n = numberMaybeFail(num); if (n) |value| { std.debug.print("={}. ", .{value}); } else |err| switch (err) { -- cgit v1.2.3-ZIG