From d24089826dced3c449e4c66518365fe7310f07ee Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 10 May 2024 20:55:50 +0200 Subject: Crappy code fix 6/? --- launcher/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'launcher') diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 3a961a0..93c996b 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -112,9 +112,8 @@ fn main() { show_system_info(); println!("atomic-launcher: Compiled against rustc {}", rustc_version_runtime::version()); - let exec_path = std::env::current_exe(); - let work_dir = exec_path.as_ref().map(|p| p.parent()).ok() - .unwrap_or(Some(Path::new("/"))) + let exec_path = std::env::current_exe().ok(); + let work_dir = exec_path.as_ref().and_then(|p| p.parent()) .unwrap_or(Path::new("/")); println!("atomic-launcher: Current directory: {}", work_dir -- cgit