mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
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:
@@ -23,7 +23,7 @@ main :: proc() {
|
||||
img, err = png.load(file, options);
|
||||
defer png.destroy(img);
|
||||
|
||||
if !png.is_kind(err, png.E_General.OK) {
|
||||
if err != png.E_General.OK {
|
||||
fmt.printf("Trying to read PNG file %v returned %v\n", file, err);
|
||||
} else {
|
||||
v: png.Info;
|
||||
@@ -120,7 +120,7 @@ main :: proc() {
|
||||
}
|
||||
}
|
||||
|
||||
if is_kind(err, E_General.OK) && .do_not_decompress_image not_in options && .info not_in options {
|
||||
if err == E_General.OK && .do_not_decompress_image not_in options && .info not_in options {
|
||||
if ok := write_image_as_ppm("out.ppm", img); ok {
|
||||
fmt.println("Saved decoded image.");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user