From 5233ee97d9314f7f0e0bdf05c56d2a9e4201a596 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 18 Jan 2022 09:20:36 +0800 Subject: [PATCH] fix: format code --- examples/link.rs | 2 +- packages/desktop/src/lib.rs | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/link.rs b/examples/link.rs index bed14f8a2..da4b5b459 100644 --- a/examples/link.rs +++ b/examples/link.rs @@ -6,7 +6,7 @@ fn main() { fn app(cx: Scope) -> Element { cx.render(rsx! ( - div { + div { p { a { href: "http://dioxuslabs.com/", diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index 546db27c1..0f451bd0d 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -193,16 +193,14 @@ pub fn launch_with_props( if data.is_array() { let arr = data.as_array().unwrap(); if arr[0].is_object() { - let temp = arr[0] - .as_object() - .unwrap(); + let temp = arr[0].as_object().unwrap(); if temp.contains_key("href") { - let url = temp - .get("href").unwrap() - .as_str().unwrap(); + let url = temp.get("href").unwrap().as_str().unwrap(); match webbrowser::open(url) { - Ok(_) => {}, - Err(e) => log::trace!("Open browser error: {:?}", e), + Ok(_) => {} + Err(e) => { + log::trace!("Open browser error: {:?}", e) + } } } }