krisprice / ipnet

IpNet, Ipv4Net, and Ipv6Net types and methods for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IpAddrRange never ends when start and end are both 0

TyPR124 opened this issue · comments

I noticed this while looking at implementing some of the extra Iterator traits and methods for efficiency. This blocks several possible efficiencies with IpAddrRange and related types.

An easy fix would be to replace start with 1 in the event that start and end are equal (end is already replaced with 0 here)

If this is acceptable, I can open a PR for this, and will likely follow up with some iterator efficiencies.

Thanks for spotting this. Absolutely, please create a PR for this fix, and if you don't mind adding a test for it as well that would be appreciated. :) Happy to have you improve on iterator efficiencies also.