Cleanup (dead code; incorrect platform conditions)

GitOrigin-RevId: 9cf6b158f4d41958c636c47e686408e1229ff195
This commit is contained in:
Roman Shevchenko
2024-03-26 21:47:16 +01:00
committed by intellij-monorepo-bot
parent f2bf925e2f
commit ba2fdb5739
2 changed files with 2 additions and 27 deletions

View File

@@ -267,11 +267,6 @@ pub fn get_config_home() -> Result<PathBuf> {
get_known_folder_path(&Shell::FOLDERID_RoamingAppData, "FOLDERID_RoamingAppData")
}
#[cfg(target_os = "windows")]
pub fn get_logs_home() -> Result<Option<PathBuf>> {
Ok(None)
}
#[cfg(target_os = "windows")]
fn get_known_folder_path(rfid: &GUID, rfid_debug_name: &str) -> Result<PathBuf> {
debug!("Calling SHGetKnownFolderPath({})", rfid_debug_name);
@@ -286,31 +281,11 @@ pub fn get_config_home() -> Result<PathBuf> {
Ok(get_user_home()?.join("Library/Application Support"))
}
#[cfg(target_os = "macos")]
pub fn get_cache_home() -> Result<PathBuf> {
Ok(get_user_home()?.join("Library/Caches"))
}
#[cfg(target_os = "macos")]
pub fn get_logs_home() -> Result<Option<PathBuf>> {
Ok(Some(get_user_home()?.join("Library/Logs")))
}
#[cfg(target_os = "linux")]
pub fn get_config_home() -> Result<PathBuf> {
get_xdg_dir("XDG_CONFIG_HOME", ".config")
}
#[cfg(target_os = "linux")]
pub fn get_cache_home() -> Result<PathBuf> {
get_xdg_dir("XDG_CACHE_HOME", ".cache")
}
#[cfg(target_os = "linux")]
pub fn get_logs_home() -> Result<Option<PathBuf>> {
Ok(None)
}
#[cfg(target_os = "linux")]
fn get_xdg_dir(env_var_name: &str, fallback: &str) -> Result<PathBuf> {
if let Ok(value) = env::var(env_var_name) {

View File

@@ -7,7 +7,7 @@ mod tests {
use std::collections::HashMap;
use crate::utils::*;
#[cfg(not(target_os = "windows"))]
#[cfg(target_os = "linux")]
use {
std::path::PathBuf,
std::fs,
@@ -104,7 +104,7 @@ mod tests {
assert!(output.contains("JCEF support is disabled. Set REMOTE_DEV_SERVER_JCEF_ENABLED=true to enable"));
}
#[cfg(not(target_os = "windows"))]
#[cfg(target_os = "linux")]
fn prepare_font_config_dir(dist_root: &PathBuf) {
let font_config_root = dist_root.join("plugins/remote-dev-server/selfcontained/fontconfig");
fs::create_dir_all(&font_config_root).unwrap();