From: Brendan Hansen Date: Mon, 27 Feb 2023 00:32:07 +0000 (-0600) Subject: added: return_ok and return_err to Result X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=2e9f8e10cfc8793fdf6ad46b4851e9c165b0e682;p=onyx.git added: return_ok and return_err to Result --- diff --git a/core/container/result.onyx b/core/container/result.onyx index 4abe691e..ddf9c85f 100644 --- a/core/container/result.onyx +++ b/core/container/result.onyx @@ -21,8 +21,8 @@ Result_Data :: struct (T: type_expr, E: type_expr) { #inject Result { - // Ok :: macro (x: $T) do return .{ .Ok, .{ value = x } }; - // Err :: macro (x: $T) do return .{ .Err, .{ error = x } }; + return_ok :: macro (x: $T) do return .{ .Ok, .{ value = x } }; + return_err :: macro (x: $T) do return .{ .Err, .{ error = x } }; is_ok :: (r: #Self) => r.status == .Ok;