diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-09 13:33:02 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-09 13:33:02 -0700 |
commit | d303237c82a0d81785b8218a4d6a3f18f86f5d11 (patch) | |
tree | 28f1b91f4f77b0aecfe58cbd7ead92ce380069ff /src/lib.rs | |
parent | 4fbc33c78f7c532a3e73fc2ee124141ccf4508f0 (diff) |
Slight improvement to name of a state in IPv6 address parsing
AFTER_COLON_EXPECT_GROUP_OR_IPV4 -> AFTER_DOUBLE_COLON
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -287,7 +287,7 @@ fn validate_ipv6_address(address: &str) -> Result<(), Error> { enum ValidationState { NoGroupsYet, ColonButNoGroupsYet, - AfterColonExpectGroupOrIpv4, + AfterDoubleColon, InGroupNotIpv4, InGroupCouldBeIpv4, ColonAfterGroup, @@ -320,10 +320,10 @@ fn validate_ipv6_address(address: &str) -> Result<(), Error> { return Err(Error::IllegalCharacter); } double_colon_encountered = true; - ValidationState::AfterColonExpectGroupOrIpv4 + ValidationState::AfterDoubleColon }, - ValidationState::AfterColonExpectGroupOrIpv4 => { + ValidationState::AfterDoubleColon => { num_digits += 1; if num_digits > 4 { return Err(Error::IllegalCharacter); @@ -383,7 +383,7 @@ fn validate_ipv6_address(address: &str) -> Result<(), Error> { return Err(Error::IllegalCharacter); } else { double_colon_encountered = true; - ValidationState::AfterColonExpectGroupOrIpv4 + ValidationState::AfterDoubleColon } } else if DIGIT.contains(&c) { potential_ipv4_address_start = i; |