From 5e51bbddde3223ff0457c7086f05715a84062443 Mon Sep 17 00:00:00 2001 From: marc2332 Date: Sun, 15 Oct 2023 12:39:23 +0200 Subject: [PATCH] fmt --- examples/clipboard/src/main.rs | 26 +++++++++++--------------- examples/geolocation/src/main.rs | 6 ++---- 2 files changed, 13 insertions(+), 19 deletions(-) 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 {