Remove compiler warnings in todo example, simplify usage of elements into element.rs and fix a bug with focus not working on edit.

This commit is contained in:
Jonathan Kingston
2018-10-30 02:39:07 +00:00
parent fc0d6528fc
commit d59716ba5b
7 changed files with 242 additions and 142 deletions

View File

@ -140,14 +140,11 @@ impl Controller {
/// Set all items to complete or active.
fn toggle_all(&mut self, completed: bool) {
let mut vals = Vec::new();
self.store
.find(
ItemQuery::EmptyItemQuery,
).map(|data| {
for item in data.iter() {
vals.push(item.id.clone());
}
});
self.store.find(ItemQuery::EmptyItemQuery).map(|data| {
for item in data.iter() {
vals.push(item.id.clone());
}
});
for id in vals.iter() {
self.toggle_completed(id.to_string(), completed);
}