Skip to content

Commit 1e1ce71

Browse files
fix(ci): fix MSRV Windows import and Linux collapsible_if clippy warnings
- Add etcetera::BaseStrategy import behind cfg(windows) for data_dir() - Collapse nested if statements in check_zypper_needs_reboot and needrestart check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bf18cd6 commit 1e1ce71

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/frequency.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use std::fs;
99
use std::path::PathBuf;
1010
use std::time::{SystemTime, UNIX_EPOCH};
1111

12+
#[cfg(windows)]
13+
use etcetera::base_strategy::BaseStrategy;
1214
use tracing::debug;
1315

1416
use crate::config::StepFrequency;

src/steps/os/linux.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,14 @@ fn check_zypper_needs_reboot(ctx: &ExecutionContext) {
357357
if let Some(zypper) = which("zypper") {
358358
#[allow(clippy::disallowed_methods)]
359359
let status = std::process::Command::new(&zypper).arg("needs-rebooting").status();
360-
if let Ok(s) = status {
361-
if s.success() {
362-
println!("{}", t!("System needs a reboot after updates."));
363-
if let Ok(true) = prompt_yesno(&t!("Reboot now?")) {
364-
if let Err(e) = super::unix::reboot(ctx) {
365-
warn!("Failed to reboot: {e}");
366-
}
367-
}
360+
if let Ok(s) = status
361+
&& s.success()
362+
{
363+
println!("{}", t!("System needs a reboot after updates."));
364+
if let Ok(true) = prompt_yesno(&t!("Reboot now?"))
365+
&& let Err(e) = super::unix::reboot(ctx)
366+
{
367+
warn!("Failed to reboot: {e}");
368368
}
369369
}
370370
}
@@ -931,10 +931,10 @@ fn should_skip_needrestart(ctx: &ExecutionContext) -> Result<()> {
931931
}
932932
}
933933
Distribution::Arch => {
934-
if let Some(manager) = get_arch_package_manager(ctx) {
935-
if manager.package_installed("needrestart", ctx)? {
936-
return Err(SkipStep(String::from(msg)).into());
937-
}
934+
if let Some(manager) = get_arch_package_manager(ctx)
935+
&& manager.package_installed("needrestart", ctx)?
936+
{
937+
return Err(SkipStep(String::from(msg)).into());
938938
}
939939
}
940940
_ => {}

0 commit comments

Comments
 (0)