Introduce Task::map_with

This commit is contained in:
Héctor Ramón Jiménez 2025-02-11 02:34:10 +01:00
parent 06ece6a8c3
commit 9f21eae152
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 55 additions and 11 deletions

View file

@ -52,7 +52,7 @@ impl Example {
let task = download.start();
task.map(move |update| Message::DownloadUpdated(index, update))
task.map_with(index, Message::DownloadUpdated)
}
Message::DownloadUpdated(id, update) => {
if let Some(download) =