Provide error message when image is not found

This commit is contained in:
heyarne 2022-10-02 18:28:15 +02:00
commit f73b13d512

View file

@ -21,7 +21,8 @@ fn model(app: &App) -> Model {
.unwrap();
let file = env::args().nth(1).ok_or("Please give me a file!").unwrap();
let image = image::open(file).unwrap();
let image =
image::open(file).expect(format!("Could not open image, please check the path.").as_str());
Model { image }
}