achanda / ipnetwork

A library to work with CIDRs in rust
Apache License 2.0
121 stars 38 forks source link

ipnetwork: add netmask constructors #103

Closed lucab closed 4 years ago

lucab commented 4 years ago

This adds constructors to build all network types from a network address and network mask pair. It also rustfmt the whole project.

achanda commented 4 years ago

Thanks @lucab !

lucab commented 4 years ago

@achanda thank you for maintaining this! For reference, our consumer is at https://github.com/coreos/afterburn and I have an in-flight PR where I first had to introduce this logic: https://github.com/coreos/afterburn/pull/316/files#diff-7ee10d7f83c9157dc687e0411d9a2f4dR54-R59

achanda commented 4 years ago

Thanks for the pointer. I can cut a release today if this is required now. Otherwise, I was planning to do it mid-December.

lucab commented 4 years ago

No worries, it will take some time any way for all the bits to be in place. I'll jump on the new version without hurry once it's available, and in the meanwhile the small bit of logic duplication is perfectly fine.