Open darrinsmart opened 4 years ago
HI @darrinsmart -- I'll keep this issue around to track and when I have time implement this. Thanks 👍
@krisprice although I can appreciate that this might be useful in some applications, it will break others if it's done silently in the FromStr
impls. There are plenty of places (e.g. most vendor config syntaxes, RPSL) were the abbreviated form is not legal.
I'd suggest a separate constructor for this.
This works:
let net4 = Ipv4Net::from_str("10.1.1.0/24").unwrap();
But this doesn't:
let net4 = Ipv4Net::from_str("10.1.1/24").unwrap();
This abbreviated form of IPv4 CIDR - omitting trailing 0 octets, is fairly common, it would be great if ipnet could accept these.