From 3cdd1ee3bc65ff94762f146bcba7684603f46c1c Mon Sep 17 00:00:00 2001 From: Daniel Sharifi Date: Fri, 24 Jan 2025 20:29:37 +0100 Subject: [PATCH] rename to `idx` --- src/server_name.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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!(