formatting: run cargo fmt

This commit is contained in:
Jonathan Kelley committed 2022-01-03 01:20:05 -05:00
1 parent 5da0a0c97e
commit a95dead76d
4 files changed
+13 -22

No files matched your search

+5 -7
View File
@@ -1,6 +1,5 @@
use dioxus::prelude::*;
fn main() {
dioxus::desktop::launch(app);
}
@@ -19,7 +18,6 @@ pub struct TodoItem {
pub contents: String,
}
pub fn app(cx: Scope<()>) -> Element {
let todos = use_state(&cx, || im_rc::HashMap::<u32, TodoItem>::default());
let filter = use_state(&cx, || FilterState::All);
@@ -80,9 +78,9 @@ pub fn app(cx: Scope<()>) -> Element {
}
(!todos.is_empty()).then(|| rsx!(
footer { class: "footer",
span { class: "todo-count",
strong {"{items_left} "}
span {"{item_text} left"}
span { class: "todo-count",
strong {"{items_left} "}
span {"{item_text} left"}
}
ul { class: "filters",
li { class: "All", a { onclick: move |_| filter.set(FilterState::All), "All" }}
@@ -90,8 +88,8 @@ pub fn app(cx: Scope<()>) -> Element {
li { class: "Completed", a { onclick: move |_| filter.set(FilterState::Completed), "Completed" }}
}
(show_clear_completed).then(|| rsx!(
button {
class: "clear-completed",
button {
class: "clear-completed",
onclick: move |_| todos.modify().retain(|_, todo| todo.checked == false),
"Clear completed"
}