Make or_else and or_return operators (binary and suffix respectively)

This commit is contained in:
gingerBill
2021-08-15 17:14:35 +01:00
parent a3a20f09e2
commit 21cbac755e
16 changed files with 247 additions and 195 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ link_error_delete :: proc(lerr: Maybe(Link_Error)) {
is_platform_error :: proc(ferr: Error) -> (err: i32, ok: bool) {
v := or_else(ferr.(Platform_Error), {});
v := ferr.(Platform_Error) or_else {};
return v.err, v.err != 0;
}
+1 -1
View File
@@ -13,7 +13,7 @@ error_to_io_error :: proc(ferr: Error) -> io.Error {
if ferr == nil {
return .None;
}
return or_else(ferr.(io.Error), .Unknown);
return ferr.(io.Error) or_else .Unknown;
}