Closed rwestphal closed 6 months ago
I totally agree that it should support ipnetwork
types. However, I think that we should also make ipnet
an optional dependency (and keep it as a default feature to not break existing code). I will (hopefully) look at it beginning next week. In the mean time, I will merge this, but I will not have time yet to update the thing on crates.io. Thank you for the contribution!
@tiborschneider That sounds great! I thought about doing that, but a lot of unit tests and benchmarks use the Ipv4Net
type, so I didn't know how that could work. Thank you for writing this crate!
I just published v0.3.0, where both ipnetwork
and ipnet
are optional dependencies, but ipnet
is enabled by default.
In the Rust ecosystem, both the "ipnet" and "ipnetwork" crates are widely used for representing IP prefixes. This crate, however, implements the
Prefix
trait only for the "ipnet" prefix types.In this commit, we introduce an optional feature that enables the implementation of the
Prefix
trait for theIpv4Network
andIpv6Network
types of the "ipnetwork" crate, making this crate more accessible to a wider audience.