-
Notifications
You must be signed in to change notification settings - Fork 35
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
update cidr methods #106
update cidr methods #106
Conversation
Codecov Report
@@ Coverage Diff @@
## master #106 +/- ##
==========================================
+ Coverage 67.19% 68.28% +1.08%
==========================================
Files 64 63 -1
Lines 5463 5659 +196
==========================================
+ Hits 3671 3864 +193
- Misses 1792 1795 +3
Continue to review full report at Codecov.
|
@@ -45,6 +58,34 @@ impl Default for Ipv4Cidr { | |||
} | |||
} | |||
|
|||
#[derive(Clone, Debug)] | |||
pub struct Ipv4CidrIterator { | |||
next: Option<u32>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify why next
is an Option but end is not? Can next
ever be None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next
is an option as it changes on each iteration and can be point to nothing ahead or None. end
is statically defined. next
can be None, and I'm about to push an assert on the tests to show finishing iterating through the cidr range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah I see you have defined next
can be None
when end has reached. It makes sense now, thnx
af9dd03
to
8e4224c
Compare
8e4224c
to
31f4efa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Enhance our CIDR trait and increase testing coverage on the mod. Obviously, always down for further cleanup and better comments.
Type of change
Checklist