Skip to content

Commit

Permalink
fix: wrong deref of usize
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Miao committed Apr 12, 2024
1 parent 32fd080 commit 5df2c8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/types/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl Buffer {
let mut ret = Vec::with_capacity(parts.len() - *idx);
let mut new_offset = *offset;
for part in parts.iter().skip(*idx) {
ret.push(IoSlice::new(&part[*new_offset..]));
ret.push(IoSlice::new(&part[new_offset..]));
new_offset = 0;
}
ret
Expand Down Expand Up @@ -376,7 +376,7 @@ impl Buf for Buffer {
.skip(*idx)
.zip(dst.iter_mut())
.map(|(part, dst)| {
*dst = IoSlice::new(&part[*new_offset..]);
*dst = IoSlice::new(&part[new_offset..]);
new_offset = 0;
})
.count()
Expand Down

0 comments on commit 5df2c8b

Please sign in to comment.