From 56c5ff82749affb3e79d0a21ed105bc0df7982c8 Mon Sep 17 00:00:00 2001 From: Tlntin <371043382@qq.com> Date: Wed, 7 Dec 2022 10:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/main.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index c54e603..c8d805e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -203,7 +203,7 @@ fn main() -> wry::Result<()> { let data_path = std::path::PathBuf::from(&config_path); #[cfg(target_os = "linux")] if !std::path::Path::new(&data_path).exists() { - std::fs::create_dir(&data_path).expect(&format!("can't create dir {}", &config_path)); + std::fs::create_dir(&data_path).unwrap_or_else(|_| panic!("can't create dir {}", &config_path)); } #[cfg(target_os = "linux")] let mut web_content = WebContext::new(Some(data_path)); @@ -253,11 +253,7 @@ fn main() -> wry::Result<()> { fn get_windows_config() -> (Option,Option) { let config_file = include_str!("../tauri.conf.json"); let config: Config = serde_json::from_str(config_file).expect("failed to parse windows config"); - - ( - config.package.product_name.clone(), - config.tauri.windows.first().cloned() - ) + (config.package.product_name.clone(),config.tauri.windows.first().cloned()) } #[cfg(target_os = "windows")]