macro_rules! as_ipnet {
($x:expr) => { ... };
}Expand description
Get expression as ipnet::IpNet
Shorthand for expr.parse::<IpNet>().unwrap()
ยงExamples
use wireguard_conf::as_ipnet;
use ipnet::IpNet;
assert_eq!(as_ipnet!("1.2.3.4/24"), "1.2.3.4/24".parse().unwrap());
assert_eq!(as_ipnet!("fd00:DEAD:BEEF::1/24"), "fd00:DEAD:BEEF::1/24".parse().unwrap());