Skip to content

Commit

Permalink
fix cranky check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzay committed Feb 19, 2024
1 parent 469fd8e commit f206c77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/egui_extras/src/loaders/image_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ impl ImageLoader for ImageCrateLoader {
let ctx = ctx.clone();
let cache = self.cache.clone();

let uri = uri.to_owned();
let uri = uri.clone();
move || {
log::trace!("ImageLoader - started loading {uri:?}");
let result = crate::image::load_image_bytes(&bytes).map(Arc::new);
log::trace!("ImageLoader - finished loading {uri:?}");
let prev = cache.lock().insert(uri.into(), Poll::Ready(result));
let prev = cache.lock().insert(uri, Poll::Ready(result));
assert!(matches!(prev, Some(Poll::Pending)));

ctx.request_repaint();
}
})
.expect("failed to spawn thread");

return Ok(ImagePoll::Pending { size: None });
Ok(ImagePoll::Pending { size: None })
}
Ok(BytesPoll::Pending { size }) => Ok(ImagePoll::Pending { size }),
Err(err) => Err(err),
Expand Down

0 comments on commit f206c77

Please sign in to comment.