HOLY sweep

This commit is contained in:
lda
2026-04-04 07:14:52 +07:00 Unverified
parent 36025f96ca
commit 0b3baa4f1b
18 changed files with 37 additions and 29 deletions
+3 -1
View File
@@ -221,7 +221,9 @@ pub fn parse_neighbor_line(s: &str) -> Result<NeighborEntry, NeighborParseError>
}
}
if state.is_none() && let Some(st) = last_tok {
if state.is_none()
&& let Some(st) = last_tok
{
state = Some(st.parse()?);
}
+6 -2
View File
@@ -6,7 +6,9 @@ pub fn parse_numeric_ipv4(s: &str) -> Option<std::net::IpAddr> {
{
return Some(std::net::IpAddr::V4(std::net::Ipv4Addr::from(n)));
}
if s.chars().all(|c| c.is_ascii_digit()) && let Ok(n) = s.parse::<u32>() {
if s.chars().all(|c| c.is_ascii_digit())
&& let Ok(n) = s.parse::<u32>()
{
return Some(std::net::IpAddr::V4(std::net::Ipv4Addr::from(n)));
}
if s.len() > 1
@@ -95,7 +97,9 @@ pub mod mac {
D: Deserializer<'de>,
{
let s = Option::<String>::deserialize(deserializer)?;
s.map(|x| x.parse()).transpose().map_err(serde::de::Error::custom)
s.map(|x| x.parse())
.transpose()
.map_err(serde::de::Error::custom)
}
}
}