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

View file

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