review: fix CheapCloneForRead for FullSlice

consider cases where offset != 0

Signed-off-by: Yuchen Liang <yuchen@neon.tech>
This commit is contained in:
Yuchen Liang
2024-12-02 16:17:04 +00:00
parent bf9a6d0f4c
commit fac42692d4

View File

@@ -50,9 +50,10 @@ where
B: IoBuf + CheapCloneForRead,
{
fn cheap_clone(&self) -> Self {
Self {
slice: self.slice.get_ref().cheap_clone().slice_full(),
}
let bounds = self.slice.bounds();
let clone = self.slice.get_ref().cheap_clone();
let slice = clone.slice(bounds);
Self { slice }
}
}