diff --git a/desktop/src-tauri/src/setup.rs b/desktop/src-tauri/src/setup.rs index f37ed91f..c65a64bb 100644 --- a/desktop/src-tauri/src/setup.rs +++ b/desktop/src-tauri/src/setup.rs @@ -29,11 +29,10 @@ pub fn setup(app: &App) -> Result<(), Box> { // Create app directories let local_app_data_dir = app.path().app_local_data_dir()?; let app_config_dir = app.path().app_local_data_dir()?; - fs::create_dir_all(local_app_data_dir).expect(&format!( - "cant create local app data directory at {}", - local_app_data_dir.display() - )); - fs::create_dir_all(app_config_dir).expect(&format!("cant create app config directory at {}", app_config_dir.display())); + fs::create_dir_all(&local_app_data_dir) + .unwrap_or_else(|_| panic!("cant create local app data directory at {}", local_app_data_dir.display())); + fs::create_dir_all(&app_config_dir) + .unwrap_or_else(|_| panic!("cant create app config directory at {}", app_config_dir.display())); // Manage model context app.manage(Mutex::new(None::));