diff --git a/src/server_name.rs b/src/server_name.rs index b038daf..64dec3c 100644 --- a/src/server_name.rs +++ b/src/server_name.rs @@ -330,9 +330,9 @@ const fn validate(input: &[u8]) -> Result<(), InvalidDnsNameError> { return Err(InvalidDnsNameError); } - let mut character_index = 0; - while character_index < input.len() { - let ch = input[character_index]; + let mut idx = 0; + while idx < input.len() { + let ch = input[idx]; state = match (state, ch) { (Start | Next | NextAfterNumericOnly | Hyphen { .. }, b'.') => { return Err(InvalidDnsNameError) @@ -358,7 +358,7 @@ const fn validate(input: &[u8]) -> Result<(), InvalidDnsNameError> { ) => Subsequent { len: len + 1 }, _ => return Err(InvalidDnsNameError), }; - character_index += 1; + idx += 1; } if matches!(