Replace with function with Function trait

This commit is contained in:
Héctor Ramón Jiménez 2025-02-11 10:36:45 +01:00
parent 080db34849
commit eab723866e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 75 additions and 79 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::{with, Center, Element, Right, Task};
use iced::{Center, Element, Function, Right, Task};
pub fn main() -> iced::Result {
iced::application(
@ -52,7 +52,7 @@ impl Example {
let task = download.start();
task.map(with(Message::DownloadUpdated, index))
task.map(Message::DownloadUpdated.with(index))
}
Message::DownloadUpdated(id, update) => {
if let Some(download) =