From 2c2b149c31c000bb0d1665da52ab42be90d8895a Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 10 May 2024 21:06:00 +0200 Subject: Crappy code fix 7/? --- launcher/src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'launcher') 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::>() .join(", ") .as_str()); let mut valid_path: Option = 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; -- cgit