diff --git a/rust/src/dns/detect.rs b/rust/src/dns/detect.rs index 268a409eac..0ee3891983 100644 --- a/rust/src/dns/detect.rs +++ b/rust/src/dns/detect.rs @@ -33,7 +33,7 @@ pub struct DetectDnsOpcode { /// the details of the error. fn parse_opcode(opcode: &str) -> Result { let mut negated = false; - for (i, c) in opcode.chars().enumerate() { + for (i, c) in opcode.char_indices() { match c { ' ' | '\t' => { continue;