diff --git a/lib/cli/src/cli.rs b/lib/cli/src/cli.rs index 586fc630edd..34c2c1835d2 100644 --- a/lib/cli/src/cli.rs +++ b/lib/cli/src/cli.rs @@ -252,11 +252,7 @@ fn wasmer_main_inner() -> Result<(), anyhow::Error> { let debug = false; #[cfg(feature = "debug")] let debug = r.options.debug; - #[cfg(test)] - let result = crate::commands::try_run_package_or_file("wasmer_main_inner", &args, r, debug); - #[cfg(not(test))] - let result = crate::commands::try_run_package_or_file(&args, r, debug); - return result; + return crate::commands::try_run_package_or_file(&args, r, debug); } options.execute() diff --git a/lib/cli/src/commands/login.rs b/lib/cli/src/commands/login.rs index 8e70b40ebfa..539f132b147 100644 --- a/lib/cli/src/commands/login.rs +++ b/lib/cli/src/commands/login.rs @@ -1,4 +1,5 @@ use clap::Parser; +#[cfg(not(test))] use dialoguer::Input; /// Subcommand for listing packages diff --git a/lib/cli/src/commands/run.rs b/lib/cli/src/commands/run.rs index 4947f009362..52c597287ea 100644 --- a/lib/cli/src/commands/run.rs +++ b/lib/cli/src/commands/run.rs @@ -822,7 +822,6 @@ fn test_fixup_args() { } pub(crate) fn try_run_package_or_file( - #[cfg(test)] test_name: &str, args: &[String], r: &Run, debug: bool, @@ -830,9 +829,6 @@ pub(crate) fn try_run_package_or_file( let debug_msgs_allowed = isatty::stdout_isatty(); if let Ok(url) = url::Url::parse(&format!("{}", r.path.display())) { - #[cfg(test)] - let result = try_run_url(test_name, &url, args, r, debug); - #[cfg(not(test))] let result = try_run_url(&url, args, r, debug); return result; } @@ -919,13 +915,7 @@ pub(crate) fn try_run_package_or_file( try_autoinstall_package(args, &sv, package_download_info, r.force_install) } -fn try_run_url( - #[cfg(test)] test_name: &str, - url: &Url, - _args: &[String], - r: &Run, - _debug: bool, -) -> Result<(), anyhow::Error> { +fn try_run_url(url: &Url, _args: &[String], r: &Run, _debug: bool) -> Result<(), anyhow::Error> { let checksum = wasmer_registry::get_remote_webc_checksum(url) .map_err(|e| anyhow::anyhow!("error fetching {url}: {e}"))?;