Skip to content

Commit 87fb3c9

Browse files
committed
Avoid using .. operator in c!
1 parent 802aa60 commit 87fb3c9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

examples/02-todo/src/lib.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,23 @@ impl Component for TaskList {
110110
fn render(&self) -> VNode {
111111
h!(div[."task-list"]).build(c![
112112
//
113-
h!(ul).build(c![
114-
..self.tasks.value().iter().enumerate().map(
115-
|(i, (done, description))| {
113+
h!(ul).build(
114+
self
115+
.tasks
116+
.value()
117+
.iter()
118+
.enumerate()
119+
.map(|(i, (done, description))| {
116120
TaskItem {
117121
id: i,
118122
description: description.clone(),
119123
done: *done,
120124
on_change: self.on_change.clone(),
121125
}
122126
.build_with_key(Some(&i.to_string()))
123-
}
124-
)
125-
])
127+
})
128+
.collect()
129+
)
126130
])
127131
}
128132
}

0 commit comments

Comments
 (0)