diff options
author | RaindropsSys <raindrops@equestria.dev> | 2024-05-10 21:06:00 +0200 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2024-05-10 21:06:00 +0200 |
commit | 2c2b149c31c000bb0d1665da52ab42be90d8895a (patch) | |
tree | bf8716b6c5aa7f5117aed7fc17e427c31d978cf1 | |
parent | d24089826dced3c449e4c66518365fe7310f07ee (diff) | |
download | atomic-2c2b149c31c000bb0d1665da52ab42be90d8895a.tar.gz atomic-2c2b149c31c000bb0d1665da52ab42be90d8895a.tar.bz2 atomic-2c2b149c31c000bb0d1665da52ab42be90d8895a.zip |
Crappy code fix 7/?
-rw-r--r-- | launcher/src/main.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 93c996b..8fdeea1 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -113,12 +113,13 @@ fn main() { println!("atomic-launcher: Compiled against rustc {}", rustc_version_runtime::version()); let exec_path = std::env::current_exe().ok(); - let work_dir = exec_path.as_ref().and_then(|p| p.parent()) + let work_dir = exec_path.as_ref() + .and_then(|p| p.parent()) .unwrap_or(Path::new("/")); println!("atomic-launcher: Current directory: {}", work_dir .to_str() - .unwrap_or("/")); + .unwrap()); let mut found_app = false; let mut app_path = PathBuf::from(work_dir); @@ -129,7 +130,7 @@ fn main() { } else { println!("atomic-launcher: Warning: Could not find Electron-compatible app. Looked in {}. The default atomic-runtime application will be opened instead.", app_path .to_str() - .unwrap_or("/")); + .unwrap()); } let runtime_search_paths = get_search_paths(); @@ -138,14 +139,14 @@ fn main() { .iter() .map(|i| i .to_str() - .unwrap_or("/")) + .unwrap()) .collect::<Vec<&str>>() .join(", ") .as_str()); let mut valid_path: Option<PathBuf> = None; for path in runtime_search_paths { - let path_str = path.to_str().unwrap_or("/"); + let path_str = path.to_str().unwrap(); if path.as_path().exists() && Path::new(&format!("{}/{}", path_str, BINARY_PATH)).exists() { valid_path = Some(path); break; |