Skip to content

Commit

Permalink
storage: Assert size read by opendal
Browse files Browse the repository at this point in the history
  • Loading branch information
tontinton committed Jun 29, 2024
1 parent a388452 commit 92ae257
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/opendal_file_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ impl std::fmt::Debug for OpenDalFileHandle {
impl FileHandle for OpenDalFileHandle {
fn read_bytes(&self, range: Range<usize>) -> std::io::Result<OwnedBytes> {
let mut bytes = Vec::new();
self.handle.block_on(
let size = self.handle.block_on(
self.reader
.read_into(&mut bytes, range.start as u64..range.end as u64),
)?;
assert_eq!(size, bytes.len());
Ok(OwnedBytes::new(bytes))
}
}
Expand Down

0 comments on commit 92ae257

Please sign in to comment.