aboutsummaryrefslogtreecommitdiff
path: root/exercises/033_iferror.zig
diff options
context:
space:
mode:
authorDave Gauer <ratfactor@gmail.com>2022-01-06 18:08:43 -0500
committerGitHub <noreply@github.com>2022-01-06 18:08:43 -0500
commit0efa4c124265ca5c009d63942d863e3911ea3197 (patch)
tree62a24ae4a7c56aa5251cf5f2f35d8e706e1cd961 /exercises/033_iferror.zig
parentd61a6e847425cf6fc8bb84bc1ffa59d259d85ccc (diff)
parent669d4f7337d43628fd031888d9dc46d22289fcdf (diff)
downloadziglings-0efa4c124265ca5c009d63942d863e3911ea3197.tar.gz
ziglings-0efa4c124265ca5c009d63942d863e3911ea3197.tar.bz2
ziglings-0efa4c124265ca5c009d63942d863e3911ea3197.tar.xz
ziglings-0efa4c124265ca5c009d63942d863e3911ea3197.zip
Merge pull request #88 from adamu/const
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) {