diff --git a/src/service.rs b/src/service.rs index 0b31e8b..3a2a81d 100644 --- a/src/service.rs +++ b/src/service.rs @@ -31,7 +31,9 @@ use std::path::{Path, PathBuf}; use anyhow::{Context, Result}; -use crate::util::{command_line, run, run_ok}; +// `command_line` is used only by the Windows registration path, so it is qualified at its call +// site rather than imported here — an unconditional import is an unused-import error on Linux. +use crate::util::{run, run_ok}; /// The unit file name, and the systemd service name with its suffix. pub const SYSTEMD_UNIT: &str = "runicgateway-link.service"; @@ -149,7 +151,7 @@ fn prepare_platform() -> Prepared { /// Creates the dedicated system user if it is not already there. Returns whether it created it. #[cfg(unix)] fn ensure_user(user: &str) -> Result { - if run("id", &["-u", user]).map(|o| o.status.success()) == Ok(true) { + if run("id", &["-u", user]).is_ok_and(|o| o.status.success()) { return Ok(false); } // `useradd` is the near-universal spelling; `adduser` is the fallback for Debian's wrapper and @@ -373,7 +375,7 @@ fn register_windows(binary: &Path, config: &Path, restart: bool) -> Result