Skip to content

Commit 75a7111

Browse files
committed
refactor(build): extract version error message
- Extract error message into `err_msg` variable - Separate formatting logic from error handling - Improve code readability in version check
1 parent 628a897 commit 75a7111

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const min_zig_string = "0.14.0";
1212
comptime {
1313
const min_zig = std.SemanticVersion.parse(min_zig_string) catch unreachable;
1414
if (current_zig.order(min_zig) == .lt) {
15-
@compileError(std.fmt.comptimePrint("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig }));
15+
const err_msg = std.fmt.comptimePrint("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig });
16+
@compileError(err_msg);
1617
}
1718
}
1819

0 commit comments

Comments
 (0)