mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Make or_else and or_return operators (binary and suffix respectively)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user