Introduce with helper and use sipper in gallery example

This commit is contained in:
Héctor Ramón Jiménez 2025-02-11 03:39:42 +01:00
parent 9f21eae152
commit 0c528be2ea
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 143 additions and 105 deletions

View file

@ -4,7 +4,7 @@ use download::download;
use iced::task;
use iced::widget::{button, center, column, progress_bar, text, Column};
use iced::{Center, Element, Right, Task};
use iced::{with, Center, Element, Right, Task};
pub fn main() -> iced::Result {
iced::application(
@ -52,7 +52,7 @@ impl Example {
let task = download.start();
task.map_with(index, Message::DownloadUpdated)
task.map(with(Message::DownloadUpdated, index))
}
Message::DownloadUpdated(id, update) => {
if let Some(download) =