aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2020-10-09 13:33:02 -0700
committerRichard Walters <rwalters@digitalstirling.com>2020-10-09 13:33:02 -0700
commitd303237c82a0d81785b8218a4d6a3f18f86f5d11 (patch)
tree28f1b91f4f77b0aecfe58cbd7ead92ce380069ff
parent4fbc33c78f7c532a3e73fc2ee124141ccf4508f0 (diff)
Slight improvement to name of a state in IPv6 address parsing
AFTER_COLON_EXPECT_GROUP_OR_IPV4 -> AFTER_DOUBLE_COLON
-rw-r--r--src/Uri.cpp8
-rw-r--r--src/lib.rs8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Uri.cpp b/src/Uri.cpp
index 2b15ede..41ea1a4 100644
--- a/src/Uri.cpp
+++ b/src/Uri.cpp
@@ -240,7 +240,7 @@ namespace {
enum class ValidationState {
NO_GROUPS_YET,
COLON_BUT_NO_GROUPS_YET,
- AFTER_COLON_EXPECT_GROUP_OR_IPV4,
+ AFTER_DOUBLE_COLON,
IN_GROUP_NOT_IPV4,
IN_GROUP_COULD_BE_IPV4,
COLON_AFTER_GROUP,
@@ -274,14 +274,14 @@ namespace {
return false;
} else {
doubleColonEncountered = true;
- state = ValidationState::AFTER_COLON_EXPECT_GROUP_OR_IPV4;
+ state = ValidationState::AFTER_DOUBLE_COLON;
}
} else {
return false;
}
} break;
- case ValidationState::AFTER_COLON_EXPECT_GROUP_OR_IPV4: {
+ case ValidationState::AFTER_DOUBLE_COLON: {
if (DIGIT.Contains(c)) {
potentialIpv4AddressStart = position;
if (++numDigits > 4) {
@@ -340,7 +340,7 @@ namespace {
return false;
} else {
doubleColonEncountered = true;
- state = ValidationState::AFTER_COLON_EXPECT_GROUP_OR_IPV4;
+ state = ValidationState::AFTER_DOUBLE_COLON;
}
} else if (DIGIT.Contains(c)) {
potentialIpv4AddressStart = position;
diff --git a/src/lib.rs b/src/lib.rs
index cf48082..2ac49cb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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;