treewide: cargo fmt
This commit is contained in:
+3
-4
@@ -50,16 +50,15 @@ async fn main() -> anyhow::Result<()> {
|
||||
))?,
|
||||
)?;
|
||||
|
||||
let fd_map: HashMap<String, OwnedFd> = HashMap::from_iter(
|
||||
sd_notify::listen_fds_with_names()?.map(|(fd_num, name)| {
|
||||
let fd_map: HashMap<String, OwnedFd> =
|
||||
HashMap::from_iter(sd_notify::listen_fds_with_names()?.map(|(fd_num, name)| {
|
||||
(
|
||||
name.clone(),
|
||||
// SAFETY: please don't mess around with file descriptors in random places
|
||||
// around the codebase lol
|
||||
unsafe { std::os::fd::OwnedFd::from_raw_fd(fd_num) },
|
||||
)
|
||||
}),
|
||||
);
|
||||
}));
|
||||
|
||||
let mut join_set = tokio::task::JoinSet::new();
|
||||
|
||||
|
||||
+8
-14
@@ -14,22 +14,16 @@ use crate::proto::finger_protocol::{FingerResponseUserEntry, FingerResponseUserS
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub enum FingerRequestNetworking {
|
||||
Any,
|
||||
IPv4Only,
|
||||
IPv6Only,
|
||||
Any,
|
||||
IPv4Only,
|
||||
IPv6Only,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub enum FingerRequestInfo {
|
||||
ShortHost {
|
||||
restrict_gecos: bool,
|
||||
},
|
||||
ShortOffice {
|
||||
restrict_gecos: bool,
|
||||
},
|
||||
Long {
|
||||
prevent_files: bool,
|
||||
},
|
||||
ShortHost { restrict_gecos: bool },
|
||||
ShortOffice { restrict_gecos: bool },
|
||||
Long { prevent_files: bool },
|
||||
}
|
||||
|
||||
/// Search for users whose username or full name contains the search string.
|
||||
@@ -54,7 +48,7 @@ pub fn search_for_user(
|
||||
|
||||
let username = user.name;
|
||||
let full_name = String::from_utf8_lossy(
|
||||
&user
|
||||
user
|
||||
.gecos
|
||||
.as_bytes()
|
||||
.split(|&b| b == b',')
|
||||
@@ -69,7 +63,7 @@ pub fn search_for_user(
|
||||
match get_local_user(&username) {
|
||||
Ok(Some(user_entry)) => Some(Ok(user_entry)),
|
||||
Ok(None) => None, // User exists but has .nofinger, skip
|
||||
Err(err) => Some(Err(err.into())),
|
||||
Err(err) => Some(Err(err)),
|
||||
}
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user