Replacing with_slice with lock_slice

This commit is contained in:
Pauan 2018-06-22 08:08:04 -10:00
parent f6445756d0
commit bfd990c12e
1 changed files with 4 additions and 2 deletions

View File

@ -249,11 +249,13 @@ fn main() {
event(clone!(state => move |event: ChangeEvent| {
let checked = !get_checked(&event);
state.todo_list.with_slice(|todo_list| {
{
let todo_list = state.todo_list.lock_slice();
for todo in todo_list.iter() {
todo.completed.set(checked);
}
});
}
state.serialize();
}));