Skip to content

Commit f6a6528

Browse files
jbryoshuawuyts
andcommitted
Incorporate feedback from review
Co-authored-by: Yoshua Wuyts <[email protected]>
1 parent ed6f181 commit f6a6528

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/chunked/encoder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ fn max_bytes_to_read(buf_len: usize) -> usize {
2626
if buf_len < 6 {
2727
panic!("buffers of length {} are too small for this implementation. if this is a problem for you, please open an issue", buf_len);
2828
}
29-
let max_bytes_of_hex_framing = // the maximum number of bytes that the hex representation of remaining bytes might take
30-
(((buf_len - 5) as f64).log2() / 4f64).floor() as usize;
31-
buf_len - 5 - max_bytes_of_hex_framing
29+
// the maximum number of bytes that the hex representation of remaining bytes might take
30+
let max_bytes_of_hex_framing = (((buf_len - 5) as f64).log2() / 4f64).floor();
31+
buf_len - 5 - (max_bytes_of_hex_framing as usize)
3232
}
3333

3434
impl<R: Read + Unpin> Read for ChunkedEncoder<R> {

0 commit comments

Comments
 (0)