From eb1d4345b74f4ee1b4cfcf8f89ce6fd5a3e3536c Mon Sep 17 00:00:00 2001 From: Steve Cook Date: Thu, 21 Jul 2022 02:29:42 -0400 Subject: [PATCH] Fix logic for when to link --- src/lib.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e423669..2ddd597 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,13 +21,16 @@ const DEFAULT_MESSAGE_FORMAT: &str = "json-render-diagnostics"; pub fn get_should_link(input: &mut Input) -> bool { // When running compile only commands, don't link the executable to the 3ds. // Otherwise, link and run on the 3ds but do not run locally. - input.cmd == CargoCommand::Run - || (input.cmd == CargoCommand::Test - && if !input.cargo_opts.contains(&"--no-run".to_string()) { - true - } else { - false - }) + match input.cmd { + CargoCommand::Run => { + true + } + CargoCommand::Test if !input.cargo_opts.contains(&"--no-run".to_string()) => { + input.cargo_opts.push("--no-run".to_string()); + true + } + _ => false + } } /// Extracts the user-defined message format and if there is none,