From 8a583e0644e9c3d4384bd3e378c922593b48876e Mon Sep 17 00:00:00 2001 From: lulzx Date: Mon, 20 Jul 2026 09:49:20 +0530 Subject: [PATCH 1/2] fix: address PR review follow-ups --- .github/workflows/ci.yml | 2 ++ src/bench.zig | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b06d0d9..b71a6a0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Setup Zig uses: mlugg/setup-zig@v2 diff --git a/src/bench.zig b/src/bench.zig index 30214837..a2fad0d8 100644 --- a/src/bench.zig +++ b/src/bench.zig @@ -127,7 +127,8 @@ const CharCounter = struct { fn benchMutool(allocator: std.mem.Allocator, pdf_path: []const u8) !f64 { const start = compat.nanoTimestamp(); - _ = try compat.runIgnored(&.{ "mutool", "draw", "-F", "txt", "-o", "/dev/null", pdf_path }, allocator); + const exit_code = try compat.runIgnored(&.{ "mutool", "draw", "-F", "txt", "-o", "/dev/null", pdf_path }, allocator); + if (exit_code != 0) return error.MutoolFailed; return @floatFromInt(compat.nanoTimestamp() - start); } From 7326a4e268e16f7d4840f8bc93785f0eb8a533ae Mon Sep 17 00:00:00 2001 From: lulzx Date: Mon, 20 Jul 2026 09:54:34 +0530 Subject: [PATCH 2/2] fix: report mutool execution failures --- src/bench.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bench.zig b/src/bench.zig index a2fad0d8..a265c8df 100644 --- a/src/bench.zig +++ b/src/bench.zig @@ -92,8 +92,9 @@ fn mainInner(allocator: std.mem.Allocator, args: []const []const u8) !void { if (benchMutool(allocator, pdf_path)) |mutool_ns| { std.debug.print("MuPDF: {d:>8.2} ms\n", .{mutool_ns / 1e6}); std.debug.print("Speedup: {d:>8.2}x\n", .{mutool_ns / stats.mean}); - } else |_| { - std.debug.print("(mutool not found)\n", .{}); + } else |err| switch (err) { + error.MutoolFailed => std.debug.print("(mutool failed)\n", .{}), + else => std.debug.print("(mutool not found)\n", .{}), } } }