diff --git a/examples/clipboard/src/main.rs b/examples/clipboard/src/main.rs index 77561a8..620091e 100644 --- a/examples/clipboard/src/main.rs +++ b/examples/clipboard/src/main.rs @@ -10,28 +10,24 @@ fn app(cx: Scope) -> Element { let clipboard = use_clipboard(cx); let text = use_state(cx, String::new); - let oninput = |e: FormEvent | { + let oninput = |e: FormEvent| { text.set(e.data.value.clone()); }; let oncopy = { to_owned![clipboard]; - move |_| { - match clipboard.set(text.get().clone()) { - Ok(_) => println!("Copied to clipboard: {}", text.get()), - Err(err) => println!("Error on copy: {err:?}") - } + move |_| match clipboard.set(text.get().clone()) { + Ok(_) => println!("Copied to clipboard: {}", text.get()), + Err(err) => println!("Error on copy: {err:?}"), } }; - let onpaste = move |_| { - match clipboard.get() { - Ok(contents) => { - println!("Pasted from clipboard: {contents}"); - text.set(contents); - }, - Err(err) => println!("Error on paste: {err:?}") + let onpaste = move |_| match clipboard.get() { + Ok(contents) => { + println!("Pasted from clipboard: {contents}"); + text.set(contents); } + Err(err) => println!("Error on paste: {err:?}"), }; render!( @@ -40,11 +36,11 @@ fn app(cx: Scope) -> Element { value: "{text}" } button { - onclick: oncopy, + onclick: oncopy, "Copy" } button { - onclick: onpaste, + onclick: onpaste, "Paste" } ) diff --git a/examples/geolocation/src/main.rs b/examples/geolocation/src/main.rs index 0fb3961..8969974 100644 --- a/examples/geolocation/src/main.rs +++ b/examples/geolocation/src/main.rs @@ -1,7 +1,5 @@ use dioxus::prelude::*; -use dioxus_std::geolocation::{ - init_geolocator, use_geolocation, PowerMode -}; +use dioxus_std::geolocation::{init_geolocator, use_geolocation, PowerMode}; fn main() { dioxus_desktop::launch(app); @@ -34,7 +32,7 @@ fn app(cx: Scope) -> Element { h1 { "🗺️ Dioxus Geolocation Example 🛰️" } h3 { "Your initial location is:"} - p { + p { if let Some(coords) = initial_coords { format!("Latitude: {} | Longitude: {}", coords.latitude, coords.longitude) } else {