From e59d25bea714196beda17002edfd9885f17d0db5 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Sat, 26 Nov 2022 17:10:25 +0800 Subject: [PATCH] style: cargo clippy & cargo fmt --- src-tauri/src/main.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 5664604..9dee51f 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -37,7 +37,7 @@ use wry::{ menu::MenuType, window::{Fullscreen, Window, WindowBuilder}, }, - webview::{WebViewBuilder, WebContext}, + webview::{WebContext, WebViewBuilder}, }; fn main() -> wry::Result<()> { @@ -129,9 +129,7 @@ fn main() -> wry::Result<()> { .unwrap(); #[cfg(target_os = "linux")] - let window = common_window - .build(&event_loop) - .unwrap(); + let window = common_window.build(&event_loop).unwrap(); #[cfg(target_os = "macos")] let window = common_window @@ -163,7 +161,7 @@ fn main() -> wry::Result<()> { #[cfg(target_os = "macos")] let webview = WebViewBuilder::new(window)? - .with_user_agent(&user_agent_string) + .with_user_agent(user_agent_string) .with_accept_first_mouse(true) .with_url(&url.to_string())? .with_devtools(cfg!(feature = "devtools")) @@ -174,7 +172,7 @@ fn main() -> wry::Result<()> { #[cfg(target_os = "windows")] let webview = WebViewBuilder::new(window)? - .with_user_agent(&user_agent_string) + .with_user_agent(user_agent_string) .with_accept_first_mouse(true) .with_url(&url.to_string())? .with_devtools(cfg!(feature = "devtools")) @@ -185,9 +183,8 @@ fn main() -> wry::Result<()> { // 自定义cookie文件夹,仅用于Linux // Custom Cookie folder, only for Linux #[cfg(target_os = "linux")] - let data_path = std::path::PathBuf::from( - concat!("/home/", env!("USER"), "/.config/com-tw93-weread/") - ); + let data_path = + std::path::PathBuf::from(concat!("/home/", env!("USER"), "/.config/com-tw93-weread/")); #[cfg(target_os = "linux")] if !std::path::Path::new(&data_path).exists() { std::fs::create_dir(&data_path)?; @@ -196,7 +193,7 @@ fn main() -> wry::Result<()> { let mut web_content = WebContext::new(Some(data_path)); #[cfg(target_os = "linux")] let webview = WebViewBuilder::new(window)? - .with_user_agent(&user_agent_string) + .with_user_agent(user_agent_string) .with_accept_first_mouse(true) .with_url(&url.to_string())? .with_devtools(cfg!(feature = "devtools"))