From 880661157c841f71b0a6c8386cd0356fa3d5b570 Mon Sep 17 00:00:00 2001 From: Mateo Cabanal Date: Mon, 27 Jun 2022 19:00:51 -0700 Subject: [PATCH] added error messages, replacing unwrap()'s with expect()'s --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 930f607..6d28c46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -199,7 +199,7 @@ impl CargoCommand { /// If there is no pre-built std detected in the sysroot, `build-std` is used. fn make_cargo_build_command(&self) -> Command { let rustflags = env::var("RUSTFLAGS").unwrap_or_default() - + &format!(" -L{}/libctru/lib -lctru", env::var("DEVKITPRO").unwrap()); + + &format!(" -L{}/libctru/lib -lctru", env::var("DEVKITPRO").expect("DEVKITPRO is not defined as an environment variable")); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let sysroot = Self::find_sysroot(); let mut command = Command::new(cargo); @@ -409,7 +409,7 @@ fn build_smdh(config: &CTRConfig) { .stdout(Stdio::inherit()) .stderr(Stdio::inherit()) .spawn() - .unwrap(); + .expect("smdhtool command failed, most likely due to 'smdhtool' not being in $PATH"); let status = process.wait().unwrap(); @@ -443,7 +443,7 @@ fn build_3dsx(config: &CTRConfig) { .stdout(Stdio::inherit()) .stderr(Stdio::inherit()) .spawn() - .unwrap(); + .expect("3dsxtool command failed, most likely due to '3dsxtool' not being in $PATH"); let status = process.wait().unwrap();