formatting: run cargo fmt

This commit is contained in:
Jonathan Kelley 2022-01-03 01:20:05 -05:00
parent 5da0a0c97e
commit a95dead76d
4 changed files with 13 additions and 22 deletions

View file

@ -27,7 +27,7 @@ fn app(cx: Scope) -> Element {
let description = use_state(&cx, String::new); let description = use_state(&cx, String::new);
cx.render(rsx!( cx.render(rsx!(
body { body {
margin_left: "35%", margin_left: "35%",
link { link {
rel: "stylesheet", rel: "stylesheet",

View file

@ -1,12 +1,11 @@
//! Example: Basic Tailwind usage //! Example: Basic Tailwind usage
//! //!
//! This example shows how an app might be styled with TailwindCSS. //! This example shows how an app might be styled with TailwindCSS.
//! //!
//! To minify your tailwind bundle, currently you need to use npm. Follow these instructions: //! To minify your tailwind bundle, currently you need to use npm. Follow these instructions:
//! //!
//! https://dev.to/arctic_hen7/how-to-set-up-tailwind-css-with-yew-and-trunk-il9 //! https://dev.to/arctic_hen7/how-to-set-up-tailwind-css-with-yew-and-trunk-il9
use dioxus::prelude::*; use dioxus::prelude::*;
fn main() { fn main() {
@ -44,7 +43,7 @@ pub fn app(cx: Scope) -> Element {
RightArrowIcon {} RightArrowIcon {}
} }
} }
} }
section { class: "text-gray-400 bg-gray-900 body-font", section { class: "text-gray-400 bg-gray-900 body-font",
div { class: "container mx-auto flex px-5 py-24 md:flex-row flex-col items-center", div { class: "container mx-auto flex px-5 py-24 md:flex-row flex-col items-center",
@ -73,11 +72,11 @@ pub fn app(cx: Scope) -> Element {
} }
} }
div { class: "lg:max-w-lg lg:w-full md:w-1/2 w-5/6", div { class: "lg:max-w-lg lg:w-full md:w-1/2 w-5/6",
img { img {
class: "object-cover object-center rounded", class: "object-cover object-center rounded",
src: "https://i.imgur.com/oK6BLtw.png", src: "https://i.imgur.com/oK6BLtw.png",
referrerpolicy:"no-referrer", referrerpolicy:"no-referrer",
alt: "hero", alt: "hero",
} }
} }
} }
@ -86,8 +85,6 @@ pub fn app(cx: Scope) -> Element {
)) ))
} }
pub fn StacksIcon(cx: Scope) -> Element { pub fn StacksIcon(cx: Scope) -> Element {
cx.render(rsx!( cx.render(rsx!(
svg { svg {

View file

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

View file

@ -66,7 +66,3 @@ harness = false
[[bench]] [[bench]]
name = "jsframework" name = "jsframework"
harness = false harness = false
[[example]]
name = "rows"
path = "./examples/rows.rs"