From review of #49.
Messages::remaining_count uses saturating_sub, but it no longer governs termination — next stops on offset — so it only feeds size_hint, and Messages implements ExactSizeIterator.
If the declared Message Count and the boundary walk ever disagreed, len() would quietly return the wrong number instead of failing. Datagram::decode enforces found == msg_count so they cannot disagree today; a plain -= 1 would keep it that way loudly if that ever changed.
One line, on main, so it is separate from the stack rather than widening a PR.
From review of #49.
Messages::remaining_countusessaturating_sub, but it no longer governs termination —nextstops onoffset— so it only feedssize_hint, andMessagesimplementsExactSizeIterator.If the declared Message Count and the boundary walk ever disagreed,
len()would quietly return the wrong number instead of failing.Datagram::decodeenforcesfound == msg_countso they cannot disagree today; a plain-= 1would keep it that way loudly if that ever changed.One line, on
main, so it is separate from the stack rather than widening a PR.