~jan0sch/rig

Showing details for patch 6b2f30122be33e22f5ca26a94428a2f0a369ffed.
2025-04-12 (Sat), 9:19 AM - Jens Grassel - 6b2f30122be33e22f5ca26a94428a2f0a369ffed

Add documentation.

Summary of changes
1 files modified with 2 lines added and 0 lines removed
  • src/main.zig with 2 added and 0 removed lines
diff -rN -u old-rig/src/main.zig new-rig/src/main.zig
--- old-rig/src/main.zig	2025-04-19 15:45:58.292107621 +0000
+++ new-rig/src/main.zig	2025-04-19 15:45:58.292107621 +0000
@@ -81,6 +81,8 @@
     return result;
 }
 
+/// Try to return the content of a file by trying to read it from the given
+/// path and fall back to the alternate one if the first read fails.
 fn readData(allocator: std.mem.Allocator, path: []const u8, alternate_path: []const u8) !std.ArrayList([]const u8) {
     const file = fs.openFileAbsolute(path, .{}) catch try fs.openFileAbsolute(alternate_path, .{});
     defer file.close();