Simplify TodoMVC example (#2935)
* Remove id field from TodoItem * Remove derived traits from TodoItem
This commit is contained in:
1 parent
37d5f93c21
commit
2733497038
1 file changed
-3
@@ -16,9 +16,7 @@ enum FilterState {
|
|||||||
Completed,
|
Completed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
|
||||||
struct TodoItem {
|
struct TodoItem {
|
||||||
id: u32,
|
|
||||||
checked: bool,
|
checked: bool,
|
||||||
contents: String,
|
contents: String,
|
||||||
}
|
}
|
||||||
@@ -120,7 +118,6 @@ fn TodoHeader(mut todos: Signal<HashMap<u32, TodoItem>>) -> Element {
|
|||||||
if evt.key() == Key::Enter && !draft.read().is_empty() {
|
if evt.key() == Key::Enter && !draft.read().is_empty() {
|
||||||
let id = todo_id();
|
let id = todo_id();
|
||||||
let todo = TodoItem {
|
let todo = TodoItem {
|
||||||
id,
|
|
||||||
checked: false,
|
checked: false,
|
||||||
contents: draft.to_string(),
|
contents: draft.to_string(),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user