aboutsummaryrefslogtreecommitdiff
path: root/exercises/033_iferror.zig
diff options
context:
space:
mode:
authorAdam Millerchip <adam@millerchip.net>2021-12-26 13:24:01 +0900
committerAdam Millerchip <adam@millerchip.net>2022-01-01 02:20:26 +0900
commit669d4f7337d43628fd031888d9dc46d22289fcdf (patch)
tree15167bd3007c96b4cff06955755b1459d0d184d0 /exercises/033_iferror.zig
parentef9bdb13820d0e113673ce0565f4dbd5960b2d9f (diff)
downloadziglings-669d4f7337d43628fd031888d9dc46d22289fcdf.tar.gz
ziglings-669d4f7337d43628fd031888d9dc46d22289fcdf.tar.bz2
ziglings-669d4f7337d43628fd031888d9dc46d22289fcdf.tar.xz
ziglings-669d4f7337d43628fd031888d9dc46d22289fcdf.zip
use const for variables that are never modified
Diffstat (limited to 'exercises/033_iferror.zig')
-rw-r--r--exercises/033_iferror.zig4
1 files changed, 2 insertions, 2 deletions
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) {