diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-21 12:27:40 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-21 12:27:40 +0200 |
| commit | 929f4d64fef8054cbaf34d556467a7d2b9d09b47 (patch) | |
| tree | ca2d071033659754db2e3e3a363431c1f9901d4d /src/image.rs | |
| parent | b0e5212973ce2efcb1433323d67c06eea1a81785 (diff) | |
Switch Loader from Option to io::Result
Diffstat (limited to 'src/image.rs')
| -rw-r--r-- | src/image.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/image.rs b/src/image.rs index d0719ac7..5738be5f 100644 --- a/src/image.rs +++ b/src/image.rs @@ -74,7 +74,7 @@ impl ImageCache { pub fn load(&mut self, file: FileId) -> Option<ImageId> { let id = ImageId(file.into_raw()); if let Entry::Vacant(entry) = self.images.entry(id) { - let buffer = self.loader.load_file(file)?; + let buffer = self.loader.load_file(file).ok()?; let image = Image::parse(&buffer)?; if let Some(callback) = &self.on_load { callback(id, &image); |
