summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-11 10:36:45 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-11 10:36:45 +0100
commiteab723866e1dc94ebd6d7c5c0c3ef191c80bcf59 (patch)
tree2b5a476f9da5155fd13e68957a9bbf3e3ab352a1 /examples/todos
parent080db348495f6e92f13391d3b222c5a2769b5fc1 (diff)
downloadiced-eab723866e1dc94ebd6d7c5c0c3ef191c80bcf59.tar.gz
iced-eab723866e1dc94ebd6d7c5c0c3ef191c80bcf59.tar.bz2
iced-eab723866e1dc94ebd6d7c5c0c3ef191c80bcf59.zip
Replace `with` function with `Function` trait
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/src/main.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 7faf742e..dfb73d96 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -4,7 +4,9 @@ use iced::widget::{
scrollable, text, text_input, Text,
};
use iced::window;
-use iced::{Center, Element, Fill, Font, Subscription, Task as Command};
+use iced::{
+ Center, Element, Fill, Font, Function, Subscription, Task as Command,
+};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
@@ -215,9 +217,8 @@ impl Todos {
.map(|(i, task)| {
(
task.id,
- task.view(i).map(move |message| {
- Message::TaskMessage(i, message)
- }),
+ task.view(i)
+ .map(Message::TaskMessage.with(i)),
)
}),
)