From e44e6ed30618dd9eeda81cd5a4d89833f6e81284 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 16 Dec 2024 19:04:45 +0100 Subject: [PATCH] fix: restrict return type of exit_normal and exit_fmt --- src/thespian.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thespian.zig b/src/thespian.zig index f3fc207..19bdcf0 100644 --- a/src/thespian.zig +++ b/src/thespian.zig @@ -241,7 +241,7 @@ fn store_stack_trace(a: std.mem.Allocator, stack_trace: std.builtin.StackTrace, } } -pub fn exit_normal() result { +pub fn exit_normal() error{Exit} { return set_error_msg(exit_message("normal", null)); } @@ -249,7 +249,7 @@ pub fn exit(e: []const u8) error{Exit} { return set_error_msg(exit_message(e, null)); } -pub fn exit_fmt(comptime fmt: anytype, args: anytype) result { +pub fn exit_fmt(comptime fmt: anytype, args: anytype) error{Exit} { var buf: [1024]u8 = undefined; const msg = std.fmt.bufPrint(&buf, fmt, args) catch "FMTERROR"; return set_error_msg(exit_message(msg, null));