diff --git a/src/command.rs b/src/command.rs index 1efc74b..54f9eef 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1,5 +1,4 @@ use clap::{AppSettings, Args, Parser, ValueEnum}; -use std::fmt::{Display, Formatter}; #[derive(Parser)] #[clap(name = "cargo")] @@ -35,14 +34,3 @@ impl CargoCommand { ) } } - -impl Display for CargoCommand { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - CargoCommand::Build | CargoCommand::Run => write!(f, "build"), - CargoCommand::Test => write!(f, "test"), - CargoCommand::Check => write!(f, "check"), - CargoCommand::Clippy => write!(f, "clippy"), - } - } -} diff --git a/src/lib.rs b/src/lib.rs index e50023d..045690d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -118,9 +118,16 @@ pub fn make_cargo_build_command( command.arg("-Z").arg("build-std"); } + let cmd = match cmd { + CargoCommand::Build | CargoCommand::Run => "build", + CargoCommand::Test => "test", + CargoCommand::Check => "check", + CargoCommand::Clippy => "clippy", + }; + command .env("RUSTFLAGS", rust_flags) - .arg(&cmd.to_string()) + .arg(cmd) .arg("--target") .arg("armv6k-nintendo-3ds") .arg("--message-format")