WARNING: src/lib.rs - IpNetwork::mask (line 83) Code block is not currently run as a test, but will in future versions of rustdoc. Please ensure this code block is a runnable test, or use the ignore directive.

This commit is contained in:
sharks
2018-04-15 21:04:00 -05:00
parent e075fb80f8
commit 7f684cf06e

View File

@ -79,6 +79,7 @@ impl IpNetwork {
/// That means the `prefix` most significant bits will be 1 and the rest 0
///
/// # Example
///
/// ```
/// use ipnetwork::IpNetwork;
/// use std::net::{Ipv4Addr, Ipv6Addr};
@ -92,7 +93,7 @@ impl IpNetwork {
/// assert_eq!(v6_net.mask(), Ipv6Addr::new(0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff));
/// let v6_net: IpNetwork = "ff01::0/32".parse().unwrap();
/// assert_eq!(v6_net.mask(), Ipv6Addr::new(0xffff, 0xffff, 0, 0, 0, 0, 0, 0));
///```
/// ```
pub fn mask(&self) -> IpAddr {
match *self {
IpNetwork::V4(ref a) => IpAddr::V4(a.mask()),