mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: various cleanups (#1833)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
committed by
GitHub
parent
995c5ad5d1
commit
075544e889
@ -82,13 +82,10 @@ impl FromStr for NatResolver {
|
||||
"none" => NatResolver::None,
|
||||
"publicip" | "public-ip" => NatResolver::PublicIp,
|
||||
s => {
|
||||
if let Some(ip) = s.strip_prefix("extip:") {
|
||||
NatResolver::ExternalIp(ip.parse::<IpAddr>()?)
|
||||
} else {
|
||||
return Err(ParseNatResolverError::UnknonwVariant(format!(
|
||||
let Some(ip) = s.strip_prefix("extip:") else { return Err(ParseNatResolverError::UnknonwVariant(format!(
|
||||
"Unknown Nat Resolver: {s}"
|
||||
)))
|
||||
}
|
||||
))) };
|
||||
NatResolver::ExternalIp(ip.parse::<IpAddr>()?)
|
||||
}
|
||||
};
|
||||
Ok(r)
|
||||
|
||||
Reference in New Issue
Block a user