From 8d350a8c6ba52e133110246b66cb89be246b6f84 Mon Sep 17 00:00:00 2001 From: Steve Cook Date: Thu, 21 Jul 2022 02:25:41 -0400 Subject: [PATCH] Only link for `run` and `test` subcommands. --- src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 50b084b..e423669 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,13 +21,12 @@ 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::Build + input.cmd == CargoCommand::Run || (input.cmd == CargoCommand::Test - && if input.cargo_opts.contains(&"--no-run".to_string()) { - false - } else { - input.cargo_opts.push("--no-run".to_string()); + && if !input.cargo_opts.contains(&"--no-run".to_string()) { true + } else { + false }) }