-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
In ipnet-master/src/ipnet.rs, the assertion message and comment of following 2 functions: "less then or equal to 32" and "less then or equal to 128" should be "less than or equal to 32" and "less than or equal to 128" respectively.
/// Creates a new IPv4 network address from an `Ipv4Addr` and prefix
/// length. If called from a const context it will verify prefix length
/// at compile time. Otherwise it will panic at runtime if prefix length
/// is not less then or equal to 32.
...
pub const fn new_assert(ip: Ipv4Addr, prefix_len: u8) -> Ipv4Net {
assert!(prefix_len <= 32, "PREFIX_LEN must be less then or equal to 32 for Ipv4Net");
Ipv4Net { addr: ip, prefix_len: prefix_len }
}/// Creates a new IPv6 network address from an `Ipv6Addr` and prefix
/// length. If called from a const context it will verify prefix length
/// at compile time. Otherwise it will panic at runtime if prefix length
/// is not less then or equal to 128.
...
pub const fn new_assert(ip: Ipv6Addr, prefix_len: u8) -> Ipv6Net {
assert!(prefix_len <= 128, "PREFIX_LEN must be less then or equal to 128 for Ipv6Net");
Ipv6Net { addr: ip, prefix_len: prefix_len }
}Metadata
Metadata
Assignees
Labels
No labels