Prevent divided-by-zero for empty BytesStreams

This commit is contained in:
asonix 2024-04-05 12:21:36 -05:00
parent eca3697410
commit 4021458be8

View file

@ -35,7 +35,7 @@ impl BytesStream {
tracing::debug!(
"BytesStream with {} chunks, avg length {}",
bs.chunks_len(),
bs.len() / bs.chunks_len()
bs.len() / bs.chunks_len().max(1)
);
Ok(bs)