Skip to content

Conversation

@astro
Copy link
Contributor

@astro astro commented Jul 21, 2018

Separate PR as requested in #186 (comment)

src/wire/ip.rs Outdated
}

/// Treat as subnet mask, get position of first 0
pub fn to_prefix_len(&self) -> u8 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Either this function shouldn't be pub, or it should perform more validation and ensure that self is a CIDR subnet mask.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed another commit now that adds to_prefix_len() with the requested validation. Because the fn can remain pub, Travis-CI should run without any unused fn failures this time.

@whitequark
Copy link
Contributor

Thanks. Can you please squash? (I wish Homu could do that itself... sadly autosquash is broken on it.)

@astro
Copy link
Contributor Author

astro commented Jul 22, 2018

Squashed. Travis is failing due to this one unused function that is required in #186.

@astro astro force-pushed the dhcp-wire branch 2 times, most recently from f36715f to 2542a90 Compare July 24, 2018 20:13
}

/// If `self` is a CIDR-compatible subnet mask, return `Some(prefix_len)`,
/// where `prefix_len` is the number of leading zeroes. Return `None` otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

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

This docstring wasn't particularly great; I fixed it.

@whitequark
Copy link
Contributor

@m-labs-homu r+

@m-labs-homu
Copy link

📌 Commit 565cdad has been approved by whitequark

m-labs-homu pushed a commit that referenced this pull request Jul 31, 2018
Closes: #255
Approved by: whitequark
@m-labs-homu
Copy link

⌛ Testing commit 565cdad with merge 1fbcfb0...

@m-labs-homu
Copy link

☀️ Test successful - status-travis
Approved by: whitequark
Pushing 1fbcfb0 to master...

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.

3 participants