fix a bunch of lints

This commit is contained in:
Qyriad 2026-03-22 15:57:38 +01:00
parent aed73e99be
commit 420fac5f18
5 changed files with 40 additions and 41 deletions

View file

@ -26,7 +26,7 @@ use crate::{
use crate::{OwnedFdWithFlags, TokenFd};
pub static UID: LazyLock<Uid> = LazyLock::new(|| rustix::process::getuid());
pub static UID: LazyLock<Uid> = LazyLock::new(rustix::process::getuid);
pub static USER_SOCKET_DIR: LazyLock<&'static Path> = LazyLock::new(|| {
let dir: Box<Path> = env::var_os("XDG_RUNTIME_DIR")
@ -52,19 +52,23 @@ pub enum ConvenientAttrPath {
}
impl ConvenientAttrPath {
/// Not currently used, but here for completeness.
#[expect(dead_code)]
pub fn clone_from_dotted(s: &str) -> Self {
Self::Dotted(Box::from(s))
}
/// Not currently used, but here for completeness.
#[expect(dead_code)]
pub fn clone_from_split(s: &[&str]) -> Self {
Self::from_str_iter(s.into_iter().map(Deref::deref))
Self::from_str_iter(s.iter().map(Deref::deref))
}
pub fn from_str_iter<'i, I>(iter: I) -> Self
where
I: Iterator<Item = &'i str>,
{
let boxed = iter.map(|s| Box::from(s));
let boxed = iter.map(Box::from);
Self::Split(Box::from_iter(boxed))
}
@ -254,10 +258,10 @@ impl Daemon {
debug!("opened daemon to {:?} file descriptor {fd:?}", name);
let path = match &name {
Some(name) => Some(PathBuf::from(name).into_boxed_path()),
None => None,
};
let path = name
.as_ref()
.map(PathBuf::from)
.map(PathBuf::into_boxed_path);
Self {
config_path,