summaryrefslogtreecommitdiff
path: root/exercises/023_errors3.zig
diff options
context:
space:
mode:
authorIbrahim Muftee <ibrahim@muftee.net>2026-06-29 15:11:40 -0500
committerIbrahim Muftee <ibrahim@muftee.net>2026-06-29 15:15:14 -0500
commitbdfe3df2947f8787c8a4ef8c534f6a8932e13871 (patch)
treef2df9a5f56b6c7f95c0978a861cb0ecf60560391 /exercises/023_errors3.zig
parentd093f37e1e4c5aed4a4c8d4999001134aec251ca (diff)
feat: begin solving exercises
Diffstat (limited to 'exercises/023_errors3.zig')
-rw-r--r--exercises/023_errors3.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/exercises/023_errors3.zig b/exercises/023_errors3.zig
index 195f21a..2fdc4a2 100644
--- a/exercises/023_errors3.zig
+++ b/exercises/023_errors3.zig
@@ -12,14 +12,14 @@ const MyNumberError = error{TooSmall};
pub fn main() void {
const a: u32 = addTwenty(44) catch 22;
- const b: u32 = addTwenty(4) ??? 22;
+ const b: u32 = addTwenty(4) catch 22;
std.debug.print("a={}, b={}\n", .{ a, b });
}
// Please provide the return type from this function.
// Hint: it'll be an error union.
-fn addTwenty(n: u32) ??? {
+fn addTwenty(n: u32) MyNumberError!u32 {
if (n < 5) {
return MyNumberError.TooSmall;
} else {