Skip to content

Commit

Permalink
It still isn't Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Jan 13, 2025
1 parent 94e5843 commit bae9dc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/buf/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ impl<T: Buf> Buf for Take<T> {
let buf = unsafe { std::mem::transmute::<&[u8], &'a [u8]>(buf) };
*dst = IoSlice::new(buf);
return i + 1;
} else {
// SAFETY: We could do this safely with `IoSlice::advance` if we had a larger MSRV.
let buf = unsafe { std::mem::transmute::<&[u8], &'a [u8]>(slice) };
*dst = IoSlice::new(buf);
limit -= slice.len();
}
*dst = *slice;
limit -= slice.len();
}
cnt
}
Expand Down

0 comments on commit bae9dc7

Please sign in to comment.