Skip to content
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

Merged
merged 3 commits into from
Jul 9, 2020
Merged

update cidr methods #106

merged 3 commits into from
Jul 9, 2020

Conversation

zeeshanlakhani
Copy link
Member

Description

Enhance our CIDR trait and increase testing coverage on the mod. Obviously, always down for further cleanup and better comments.

Type of change

  • New feature

Checklist

  • Associated tests
  • Associated documentation

@codecov
Copy link

codecov bot commented Jun 16, 2020

Codecov Report

Merging #106 into master will increase coverage by 1.08%.
The diff coverage is 91.63%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
core/src/dpdk/mempool.rs 37.77% <ø> (ø)
core/src/net/cidr/v4.rs 84.93% <91.15%> (+18.26%) ⬆️
core/src/net/cidr/v6.rs 85.98% <92.06%> (+19.32%) ⬆️
core/src/runtime/mod.rs 0.00% <0.00%> (ø)
core/src/macros.rs
core/src/packets/icmp/v6/ndp/mod.rs 84.23% <0.00%> (+0.07%) ⬆️
...ore/src/packets/icmp/v6/ndp/options/prefix_info.rs 87.09% <0.00%> (+0.10%) ⬆️
...src/packets/icmp/v6/ndp/options/link_layer_addr.rs 85.33% <0.00%> (+0.19%) ⬆️
core/src/packets/icmp/v6/ndp/options/mtu.rs 83.82% <0.00%> (+0.24%) ⬆️
core/src/testils/proptest/strategy.rs 83.17% <0.00%> (+0.46%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 292da76...947ae29. Read the comment docs.

@@ -45,6 +58,34 @@ impl Default for Ipv4Cidr {
}
}

#[derive(Clone, Debug)]
pub struct Ipv4CidrIterator {
next: Option<u32>,
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

core/src/net/cidr/mod.rs Outdated Show resolved Hide resolved
core/src/net/cidr/mod.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v4.rs Outdated Show resolved Hide resolved
core/src/net/cidr/v6.rs Show resolved Hide resolved
Copy link
Contributor

@drunkirishcoder drunkirishcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@zeeshanlakhani zeeshanlakhani merged commit fa45d25 into master Jul 9, 2020
@zeeshanlakhani zeeshanlakhani deleted the zl/cidr-haus-rules branch July 9, 2020 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants