mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-16 08:48:51 +00:00
If there is no prefix, default to number of bits ipv4/32, ipv6/128
This commit is contained in:
@ -35,7 +35,7 @@ impl Error for IpNetworkError {
|
||||
pub fn cidr_parts(cidr: &str) -> Result<(&str, &str), IpNetworkError> {
|
||||
let parts = cidr.split('/').collect::<Vec<&str>>();
|
||||
if parts.len() == 1 {
|
||||
Ok((parts[0], "32"))
|
||||
Ok((parts[0], ""))
|
||||
} else if parts.len() == 2 {
|
||||
Ok((parts[0], parts[1]))
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user