summaryrefslogtreecommitdiffstats
path: root/examples/gallery/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gallery/src/main.rs')
-rw-r--r--examples/gallery/src/main.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/examples/gallery/src/main.rs b/examples/gallery/src/main.rs
index ab22679d..441ad924 100644
--- a/examples/gallery/src/main.rs
+++ b/examples/gallery/src/main.rs
@@ -94,17 +94,15 @@ impl Gallery {
return Task::none();
};
- Task::batch(vec![
- Task::perform(
+ Task::batch([
+ Task::future(
image.clone().blurhash(Preview::WIDTH, Preview::HEIGHT),
- move |result| Message::BlurhashDecoded(id, result),
- ),
- Task::perform(
- image.download(Size::Thumbnail {
- width: Preview::WIDTH,
- }),
- move |result| Message::ThumbnailDownloaded(id, result),
- ),
+ )
+ .map_with(id, Message::BlurhashDecoded),
+ Task::future(image.download(Size::Thumbnail {
+ width: Preview::WIDTH,
+ }))
+ .map_with(id, Message::ThumbnailDownloaded),
])
}
Message::ImageDownloaded(Ok(rgba)) => {