diff --git a/Cargo.lock b/Cargo.lock index fa580490..8cd738c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2918,7 +2918,6 @@ name = "topgrade" version = "16.2.1" dependencies = [ "base64ct", - "cfg-if", "chrono", "clap", "clap_complete", diff --git a/Cargo.toml b/Cargo.toml index 6f0e9496..10a566bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,6 @@ glob = "~0.3" strum = { version = "~0.26", features = ["derive"] } thiserror = "~1.0" tempfile = "~3.10" -cfg-if = "~1.0" tokio = { version = "~1.47", features = ["process", "rt-multi-thread"] } futures = "~0.3" regex = "~1.10" diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 7c54f0d2..94e10d4c 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -889,12 +889,11 @@ pub fn run_tldr(ctx: &ExecutionContext) -> Result<()> { } pub fn run_tlmgr_update(ctx: &ExecutionContext) -> Result<()> { - cfg_if::cfg_if! { - if #[cfg(any(target_os = "linux", target_os = "android"))] { - if !ctx.config().enable_tlmgr_linux() { - return Err(SkipStep(String::from("tlmgr must be explicitly enabled in the configuration to run in Android/Linux")).into()); - } - } + if cfg!(any(target_os = "linux", target_os = "android")) && !ctx.config().enable_tlmgr_linux() { + return Err(SkipStep(String::from( + "tlmgr must be explicitly enabled in the configuration to run in Android/Linux", + )) + .into()); } let tlmgr = require("tlmgr")?; @@ -999,23 +998,19 @@ pub fn run_composer_update(ctx: &ExecutionContext) -> Result<()> { print_separator(t!("Composer")); if ctx.config().composer_self_update() { - cfg_if::cfg_if! { - if #[cfg(unix)] { - // If self-update fails without sudo then there's probably an update - let has_update = match ctx.execute(&composer).arg("self-update").output()? { - ExecutorOutput::Wet(output) => !output.status.success(), - _ => false - }; + if cfg!(unix) { + // If self-update fails without sudo then there's probably an update + let has_update = match ctx.execute(&composer).arg("self-update").output()? { + ExecutorOutput::Wet(output) => !output.status.success(), + _ => false, + }; - if has_update { - let sudo = ctx.require_sudo()?; - sudo.execute(ctx, &composer)? - .arg("self-update") - .status_checked()?; - } - } else { - ctx.execute(&composer).arg("self-update").status_checked()?; + if has_update { + let sudo = ctx.require_sudo()?; + sudo.execute(ctx, &composer)?.arg("self-update").status_checked()?; } + } else { + ctx.execute(&composer).arg("self-update").status_checked()?; } }