diff --git a/src/parsers/combinators.rs b/src/parsers/combinators.rs index e35048b..0f9d1dc 100644 --- a/src/parsers/combinators.rs +++ b/src/parsers/combinators.rs @@ -17,15 +17,15 @@ use crate::{ /// /// If a '/' is found, parse trailing number as prefix length and leading address with `address_parser`. /// Otherwise parse with `host_parser`. -pub fn parse_cidr_full( +pub fn parse_cidr_full( s: &str, address_parser: AP, - host_parser: NP, + host_parser: HP, ) -> Result where C: Cidr, AP: FnOnce(&str) -> Result, - NP: FnOnce(&str) -> Result, + HP: FnOnce(&str) -> Result, { match s.rfind('/') { None => host_parser(s), @@ -48,15 +48,15 @@ where /// Parse [`Cidr`] with custom address and network (when no '/' separator was found) parser /// /// Similar to [`parse_cidr_full`] but ignores host bits in addresses. -pub fn parse_cidr_full_ignore_hostbits( +pub fn parse_cidr_full_ignore_hostbits( s: &str, address_parser: AP, - host_parser: NP, + host_parser: HP, ) -> Result where C: Cidr, AP: FnOnce(&str) -> Result, - NP: FnOnce(&str) -> Result, + HP: FnOnce(&str) -> Result, { match s.rfind('/') { None => host_parser(s), @@ -89,14 +89,14 @@ where /// Return [`AnyIpCidr::Any`] for `"any"`. /// If a '/' is found, parse trailing number as prefix length and leading address with `address_parser`. /// Otherwise parse with `host_parser`. -pub fn parse_any_cidr_full( +pub fn parse_any_cidr_full( s: &str, address_parser: AP, - host_parser: NP, + host_parser: HP, ) -> Result where AP: FnOnce(&str) -> Result, - NP: FnOnce(&str) -> Result, + HP: FnOnce(&str) -> Result, { if s == "any" { return Ok(AnyIpCidr::Any); @@ -124,14 +124,14 @@ where /// Parse [`AnyIpCidr`] with custom address and network (when no '/' separator was found) parser /// /// Similar to [`parse_any_cidr_full`] but ignores host bits in addresses. -pub fn parse_any_cidr_full_ignore_hostbits( +pub fn parse_any_cidr_full_ignore_hostbits( s: &str, address_parser: AP, - host_parser: NP, + host_parser: HP, ) -> Result where AP: FnOnce(&str) -> Result, - NP: FnOnce(&str) -> Result, + HP: FnOnce(&str) -> Result, { if s == "any" { return Ok(AnyIpCidr::Any); @@ -165,15 +165,15 @@ where /// /// If a '/' is found, parse trailing number as prefix length and leading address with `address_parser`. /// Otherwise parse with `host_parser`. -pub fn parse_inet_full( +pub fn parse_inet_full( s: &str, address_parser: AP, - host_parser: NP, + host_parser: HP, ) -> Result where I: Inet, AP: FnOnce(&str) -> Result, - NP: FnOnce(&str) -> Result, + HP: FnOnce(&str) -> Result, { match s.rfind('/') { None => host_parser(s),