From 1e552a1dd6dac663a9329e5c71c5c7c245f2ed1e Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Fri, 9 Jan 2026 22:56:23 +0100 Subject: I/O improvements --- patches/patches/026_hello2.patch | 4 ++-- patches/patches/034_quiz4.patch | 11 +++-------- patches/patches/106_files.patch | 8 ++++---- patches/patches/107_files2.patch | 8 ++++---- 4 files changed, 13 insertions(+), 18 deletions(-) (limited to 'patches') diff --git a/patches/patches/026_hello2.patch b/patches/patches/026_hello2.patch index 1616c08..85f02a7 100644 --- a/patches/patches/026_hello2.patch +++ b/patches/patches/026_hello2.patch @@ -1,5 +1,5 @@ ---- exercises/026_hello2.zig 2025-12-30 13:39:29.478620712 +0100 -+++ answers/026_hello2.zig 2025-12-30 13:39:18.948412943 +0100 +--- exercises/026_hello2.zig 2026-01-09 22:51:45.803358789 +0100 ++++ answers/026_hello2.zig 2026-01-09 22:50:46.016166527 +0100 @@ -28,5 +28,5 @@ // to be able to pass it up as a return value of main(). // diff --git a/patches/patches/034_quiz4.patch b/patches/patches/034_quiz4.patch index 7cf102c..8fad042 100644 --- a/patches/patches/034_quiz4.patch +++ b/patches/patches/034_quiz4.patch @@ -1,11 +1,6 @@ ---- exercises/034_quiz4.zig 2025-12-28 14:43:41.087943476 +0100 -+++ answers/034_quiz4.zig 2025-12-28 14:42:23.878472164 +0100 -@@ -10,11 +10,11 @@ - - const NumError = error{IllegalNumber}; - --pub fn main() void { -+pub fn main() !void { +--- exercises/034_quiz4.zig 2026-01-09 22:45:53.115325559 +0100 ++++ answers/034_quiz4.zig 2026-01-09 22:45:15.658578603 +0100 +@@ -14,7 +14,7 @@ var stdout_writer = std.Io.File.stdout().writer(io, &.{}); const stdout = &stdout_writer.interface; diff --git a/patches/patches/106_files.patch b/patches/patches/106_files.patch index 8bff4d6..27bcb56 100644 --- a/patches/patches/106_files.patch +++ b/patches/patches/106_files.patch @@ -1,6 +1,6 @@ ---- exercises/106_files.zig 2025-12-28 20:38:53.005504479 +0100 -+++ answers/106_files.zig 2025-12-28 20:37:42.742154100 +0100 -@@ -39,7 +39,7 @@ +--- exercises/106_files.zig 2026-01-09 22:41:19.373872684 +0100 ++++ answers/106_files.zig 2026-01-09 22:41:44.518372910 +0100 +@@ -41,7 +41,7 @@ // by doing nothing // // we want to catch error.PathAlreadyExists and do nothing @@ -9,7 +9,7 @@ // if there's any other unexpected error we just propagate it through else => return e, }; -@@ -59,7 +59,7 @@ +@@ -61,7 +61,7 @@ // but here we are not yet done writing to the file // if only there were a keyword in Zig that // allowed you to "defer" code execution to the end of the scope... diff --git a/patches/patches/107_files2.patch b/patches/patches/107_files2.patch index 597c260..6820742 100644 --- a/patches/patches/107_files2.patch +++ b/patches/patches/107_files2.patch @@ -1,6 +1,6 @@ ---- exercises/107_files2.zig 2025-12-28 21:17:29.658147954 +0100 -+++ answers/107_files2.zig 2025-12-28 21:17:10.585787203 +0100 -@@ -38,7 +38,7 @@ +--- exercises/107_files2.zig 2026-01-09 22:43:15.211177186 +0100 ++++ answers/107_files2.zig 2026-01-09 22:42:48.943654602 +0100 +@@ -39,7 +39,7 @@ // initialize an array of u8 with all letter 'A' // we need to pick the size of the array, 64 seems like a good number // fix the initialization below @@ -9,7 +9,7 @@ // this should print out : `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA` std.debug.print("{s}\n", .{content}); -@@ -49,12 +49,12 @@ +@@ -50,12 +50,12 @@ // can you go here to find a way to read the content? // https://ziglang.org/documentation/master/std/#std.Io.Reader // hint: look for a method that reads into a slice -- cgit v1.2.3