diff options
Diffstat (limited to 'launcher/src')
-rw-r--r-- | launcher/src/main.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 6f3e21c..28813f6 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -4,29 +4,30 @@ use std::process::{Command, exit}; use dirs::home_dir; use rustc_version_runtime::version; -fn get_home() -> String { - let home_buf = home_dir() - .unwrap_or(PathBuf::from("/")); - let os_string = home_buf - .into_os_string(); - os_string - .to_string_lossy() - .to_string() +fn get_home() -> PathBuf { + home_dir() + .unwrap_or(PathBuf::from("/")) } #[cfg(target_os = "macos")] fn get_home_search() -> PathBuf { - PathBuf::from(format!("{}/Library/Frameworks/AtomicRuntime.framework", get_home())) + PathBuf::from(format!("{}/Library/Frameworks/AtomicRuntime.framework", get_home() + .to_str() + .unwrap_or("/"))) } #[cfg(target_os = "linux")] fn get_home_search() -> PathBuf { - PathBuf::from(format!("{}/.local/share/atomic-runtime", get_home())) + PathBuf::from(format!("{}/.local/share/atomic-runtime", get_home() + .to_str() + .unwrap_or("/"))) } #[cfg(target_os = "windows")] fn get_home_search() -> PathBuf { - PathBuf::from(format!("{}\\AppData\\Local\\Atomic Runtime", get_home())) + PathBuf::from(format!("{}\\AppData\\Local\\Atomic Runtime", get_home() + .to_str() + .unwrap_or("/"))) } #[cfg(target_os = "macos")] |