achanda / ipnetwork

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

[Change suggestion] Resetting the device bits to 0 when initiating new objects #145

Open digizeph opened 2 years ago

digizeph commented 2 years ago

When creating an IP network, the network address's device bits should be resets to zero and then save into the struct.

For example, I believe the following two networks should be considered the same: 8.8.8.0/24 and 8.8.8.1/24. But when the resulting IpNetwork are different, and the to_string results are also different.