Skip to content

Commit

Permalink
fix bytes iter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Mar 7, 2023
1 parent 996d050 commit f398a54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array_zstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl<const N: usize> ArrayZString<N> {
/// * This iterator *excludes* the terminating 0 byte.
#[inline]
pub fn bytes(&self) -> impl Iterator<Item = u8> + '_ {
self.0.iter().copied()
self.0.iter().copied().take_while(|&b| b != 0)
}

/// An iterator over the decoded `char` values of this `ZStr`.
Expand Down

0 comments on commit f398a54

Please sign in to comment.