From d2fb7a6ca4af28539f0629da8a0bdc70f94d570b Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Fri, 17 May 2024 13:56:24 -0400 Subject: [PATCH] Fixed error handling --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a12ea43..4804f03 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,8 @@ use image::io::Reader as ImageReader; fn main() { println!("Converting test.webp to test.png."); - let img = ImageReader::open("test.webp")?.decode()?; - img.save("test.png")?; + let img_raw = ImageReader::open("test.webp").expect("Failed to load test.webp.") + let img = img_raw.decode().expect("Failed to decode the image."); + img.save("test.png").("Failed to save test.png."); println!("Done."); }