From eaa1821673697baeb7de10993de2fe9771d704f1 Mon Sep 17 00:00:00 2001 From: Junkui Zhang <364772080@qq.com> Date: Wed, 30 Apr 2025 22:13:19 +0800 Subject: [PATCH] fix macOS --- crates/paths/src/paths.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/crates/paths/src/paths.rs b/crates/paths/src/paths.rs index f81680c1ae..5fdf78ac0f 100644 --- a/crates/paths/src/paths.rs +++ b/crates/paths/src/paths.rs @@ -441,27 +441,23 @@ pub fn vscode_settings_file() -> &'static PathBuf { let rel_path = "Code/User/settings.json"; #[cfg(target_os = "macos")] { - LOGS_DIR.get_or_init(|| { - if cfg!(target_os = "macos") { - home_dir() - .join("Library/Application Support") - .join(rel_path) - } else { - home_dir().join(".config").join(rel_path) - } - }) + return LOGS_DIR.get_or_init(|| { + home_dir() + .join("Library/Application Support") + .join(rel_path) + }); } #[cfg(target_os = "windows")] { - LOGS_DIR.get_or_init(|| { + return LOGS_DIR.get_or_init(|| { dirs::config_dir() .expect("failed to determine RoamingAppData directory") .join(rel_path) - }) + }); } #[cfg(not(any(target_os = "macis", target_os = "windows")))] { - LOGS_DIR.get_or_init(|| config_dir().join(rel_path)) + return LOGS_DIR.get_or_init(|| config_dir().join(rel_path)); } }