aboutsummaryrefslogtreecommitdiff
path: root/launcher/src
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-05-10 19:42:49 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-05-10 19:42:49 +0200
commit0d2c955098f7a16e1b844196fb6f996c5e09d9c8 (patch)
treeb53ab4317cc9e219acce0e28432c6c3322a10b44 /launcher/src
parenta0b8badf429a559f2de7176fba8184e436bd9ff4 (diff)
downloadatomic-0d2c955098f7a16e1b844196fb6f996c5e09d9c8.tar.gz
atomic-0d2c955098f7a16e1b844196fb6f996c5e09d9c8.tar.bz2
atomic-0d2c955098f7a16e1b844196fb6f996c5e09d9c8.zip
Crappy code fix 1/?
Diffstat (limited to 'launcher/src')
-rw-r--r--launcher/src/main.rs23
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")]