This is a convenience to avoid having extra match statements in the code of consumers of this crate that, like in my case, are receiving an IpAddr and prefix and would like to build a network out of that information.
Since the FromStr implementation is essentially the same situation and validation of prefix length is still handled appropriately, it would make sense for this method to exist in my opinion.
This is a convenience to avoid having extra
match
statements in the code of consumers of this crate that, like in my case, are receiving anIpAddr
and prefix and would like to build a network out of that information.Since the
FromStr
implementation is essentially the same situation and validation of prefix length is still handled appropriately, it would make sense for this method to exist in my opinion.