From: Matt Corallo Date: Tue, 9 Jul 2024 21:28:25 +0000 (+0000) Subject: Correct `TxtBytes` iteration behavior, fixing `Txt::json()` X-Git-Tag: v0.6.1~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=404e260b005eb9f4ed19a47da3d9180184e834c3;p=dnssec-prover Correct `TxtBytes` iteration behavior, fixing `Txt::json()` --- diff --git a/src/rr.rs b/src/rr.rs index 5aa7a57..a096618 100644 --- a/src/rr.rs +++ b/src/rr.rs @@ -369,13 +369,14 @@ impl<'a> Iterator for TxtBytesIter<'a> { .and_then(|part| if self.next_byte >= part.len.get() { None } else { + let res = Some(part.bytes[self.next_byte as usize]); if self.next_byte == part.len.get() - 1 { self.next_byte = 0; self.next_part += 1; } else { self.next_byte += 1; } - Some(part.bytes[self.next_byte as usize]) + res }) } }