From dd0a8c4ce4f143f193a3165ccf6ef67452581988 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 10 May 2024 20:39:28 +0200 Subject: Crappy code fix 4/? --- launcher/src/main.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index b5c16d7..0afb8aa 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1,11 +1,8 @@ -use std::env::{consts, current_exe}; use std::path::{Path, PathBuf}; -use std::process::{Command, exit}; -use dirs::home_dir; -use rustc_version_runtime::version; +use std::process; fn get_home() -> PathBuf { - home_dir() + dirs::home_dir() .unwrap_or(PathBuf::from("/")) } @@ -91,7 +88,7 @@ fn get_search_paths() -> [PathBuf; 29] { } fn show_system_info() { - println!("atomic-launcher: Starting atomic-launcher on {} ({})", consts::OS, consts::ARCH); + println!("atomic-launcher: Starting atomic-launcher on {} ({})", std::env::consts::OS, std::env::consts::ARCH); } // TODO: Rename these to "Atomic" @@ -113,9 +110,9 @@ const APP_DATA_PATH: &str = "./resources/app"; fn main() { show_system_info(); - println!("atomic-launcher: Compiled against rustc {}", version()); + println!("atomic-launcher: Compiled against rustc {}", rustc_version_runtime::version()); - let my_path_buf = current_exe() + let my_path_buf = std::env::current_exe() .unwrap_or(PathBuf::from("/")); let my_path = my_path_buf .parent() @@ -163,7 +160,7 @@ fn main() { .unwrap_or(""), BINARY_PATH)) .to_str() .unwrap_or("")); - let mut cmd = Command::new(Path::new(&format!("{}/{}", path + let mut cmd = process::Command::new(Path::new(&format!("{}/{}", path .to_str() .unwrap_or(""), BINARY_PATH))); println!("atomic-launcher: Executing: {:?}", cmd); @@ -173,17 +170,17 @@ fn main() { } if let Ok(mut app) = cmd.spawn() { - exit(app.wait() + process::exit(app.wait() .unwrap_or_default() .code() .unwrap_or(255)); } else { eprintln!("atomic-launcher: Application failed to start."); - exit(3); + process::exit(3); } } else { eprintln!("atomic-launcher: Could not find a valid atomic-runtime path. Aborting."); - exit(2); + process::exit(2); } } -- cgit