#[cfg(windows)] use omnipath::WinPathExt; use std::path::PathBuf; pub fn home_dir() -> Option { dirs_next::home_dir() } pub fn config_dir() -> Option { dirs_next::config_dir() } #[cfg(windows)] pub fn canonicalize(path: &std::path::Path) -> std::io::Result { path.canonicalize()?.to_winuser_path() } #[cfg(not(windows))] pub fn canonicalize(path: &std::path::Path) -> std::io::Result { path.canonicalize() } #[cfg(windows)] pub fn simiplified(path: &std::path::Path) -> PathBuf { path.to_winuser_path() .unwrap_or_else(|_| path.to_path_buf()) } #[cfg(not(windows))] pub fn simiplified(path: &std::path::Path) -> PathBuf { path.to_path_buf() }