chore: clippy

This commit is contained in:
Vukašin Vojinović 2026-04-25 17:34:56 +02:00 committed by Jeremy Soller
parent 56f0115952
commit a77aaa1904
3 changed files with 11 additions and 13 deletions

View file

@ -164,7 +164,7 @@ async fn start(
Ok(env) => {
for systemd_env in env {
// Only update the envvar if unset
if std::env::var_os(&systemd_env.key) == None {
if std::env::var_os(&systemd_env.key).is_none() {
// Blacklist of envvars that we shouldn't touch (taken from KDE)
if (!systemd_env.key.starts_with("XDG_")
|| systemd_env.key == "XDG_DATA_DIRS"
@ -243,11 +243,10 @@ async fn start(
.instrument(stderr_span)
})
.with_on_exit(move |_, _, _, will_restart| {
if !will_restart {
if let Some(tx) = settings_exit_tx.lock().unwrap().take() {
if !will_restart
&& let Some(tx) = settings_exit_tx.lock().unwrap().take() {
_ = tx.send(());
}
}
async {}
}),
)
@ -533,17 +532,15 @@ async fn start_component(
})
.with_on_start(move |pman, pkey, _will_restart| async move {
#[cfg(feature = "systemd")]
if *is_systemd_used() {
if let Ok((innr_cmd, Some(pid))) = pman.get_exe_and_pid(pkey).await {
if let Err(err) = spawn_scope(innr_cmd.clone(), vec![pid]).await {
if *is_systemd_used()
&& let Ok((innr_cmd, Some(pid))) = pman.get_exe_and_pid(pkey).await
&& let Err(err) = spawn_scope(innr_cmd.clone(), vec![pid]).await {
warn!(
"Failed to spawn scope for {}. Creating transient unit failed \
with {}",
innr_cmd, err
);
};
}
}
})
.with_on_exit(move |mut _pman, _key, err_code, _will_restart| {
if let Some(err) = err_code {

View file

@ -26,6 +26,7 @@ pub fn create_socket() -> Result<(OwnedFd, OwnedFd)> {
Ok((OwnedFd::from(sock_1), OwnedFd::from(sock_2)))
}
#[allow(clippy::too_many_arguments)]
pub fn notifications_process(
span: tracing::Span,
cmd: &'static str,

View file

@ -17,11 +17,11 @@ pub struct EnvVar {
pub value: String,
}
impl Into<EnvVar> for (&str, &str) {
fn into(self) -> EnvVar {
impl From<(&str, &str)> for EnvVar {
fn from(val: (&str, &str)) -> Self {
EnvVar {
key: self.0.to_owned(),
value: self.1.to_owned(),
key: val.0.to_owned(),
value: val.1.to_owned(),
}
}
}