Skip to content

Commit e0995ce

Browse files
committed
tweak write_block
1 parent 1be52dc commit e0995ce

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

block-buffer/src/read.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ impl<BS: ArraySize> ReadBuffer<BS> {
9595

9696
/// Write new block and consume `read_len` bytes from it.
9797
///
98-
/// If `read_len` is equal to zero, sets buffer to the exhausted state (i.e. it sets the cursor
99-
/// position to block size) and immediately returns without calling the closures.
98+
/// If `read_len` is equal to zero, immediately returns without calling the closures.
10099
/// Otherwise, the method calls `gen_block` to fill the internal buffer,
101100
/// passes to `read_fn` slice with first `read_len` bytes of the block,
102101
/// and sets the cursor position to `read_len`.
@@ -111,7 +110,6 @@ impl<BS: ArraySize> ReadBuffer<BS> {
111110
read_fn: impl FnOnce(&[u8]),
112111
) {
113112
if read_len == 0 {
114-
unsafe { self.set_pos_unchecked(BS::USIZE) };
115113
return;
116114
}
117115
assert!(read_len < BS::USIZE);

0 commit comments

Comments
 (0)