From 238beb4a2d3c2eacbb21bba03dcfcf1db3ec3dcb Mon Sep 17 00:00:00 2001 From: Will Clardy Date: Mon, 15 Feb 2021 16:55:44 -0500 Subject: Apply `zig fmt` to exercises --- exercises/33_iferror.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'exercises/33_iferror.zig') diff --git a/exercises/33_iferror.zig b/exercises/33_iferror.zig index ed92e94..67777a9 100644 --- a/exercises/33_iferror.zig +++ b/exercises/33_iferror.zig @@ -23,7 +23,7 @@ const MyNumberError = error{ const std = @import("std"); pub fn main() void { - var nums = [_]u8{2,3,4,5,6}; + var nums = [_]u8{ 2, 3, 4, 5, 6 }; for (nums) |num| { std.debug.print("{}", .{num}); @@ -32,7 +32,7 @@ pub fn main() void { if (n) |value| { std.debug.print("=4. ", .{}); } else |err| switch (err) { - MyNumberError.TooBig => std.debug.print(">4. ", .{}), + MyNumberError.TooBig => std.debug.print(">4. ", .{}), // Please add a match for TooSmall here and have it print: "<4. " } } @@ -43,7 +43,7 @@ pub fn main() void { // This time we'll have numberMaybeFail() return an error union rather // than a straight error. fn numberMaybeFail(n: u8) MyNumberError!u8 { - if(n > 4) return MyNumberError.TooBig; - if(n < 4) return MyNumberError.TooSmall; + if (n > 4) return MyNumberError.TooBig; + if (n < 4) return MyNumberError.TooSmall; return n; } -- cgit v1.2.3-70-g09d2