Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add convenience IpNet::new method #36

Merged
merged 1 commit into from Feb 14, 2022
Merged

Conversation

mcginty
Copy link
Contributor

@mcginty mcginty commented Jan 31, 2022

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.

@mcginty mcginty changed the title add convenience IpNet::new method add convenience IpNet::new method Jan 31, 2022
@krisprice krisprice merged commit 88699c1 into krisprice:master Feb 14, 2022
@krisprice
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants