Convert core:compress and core:image error checks to new union comparison.

No more need for `is_kind(err, Error_Value)`, just test err == Error_Value.
This commit is contained in:
Jeroen van Rijn
2021-05-03 15:08:34 +02:00
parent 357f66fcee
commit 59b3c472ca
8 changed files with 35 additions and 44 deletions
-6
View File
@@ -3,12 +3,6 @@ package compress
import "core:io"
import "core:image"
// Error helper, e.g. is_kind(err, General_Error.OK);
is_kind :: proc(u: $U, x: $V) -> bool {
v, ok := u.(V);
return ok && v == x;
}
Error :: union {
General_Error,
Deflate_Error,