Skip to content

Commit

Permalink
Use u64 for OffsetType::MAX in truncate_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Dec 8, 2024
1 parent 5aac5e0 commit 3661646
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/polars-compute/src/cast/utf8_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type OffsetType = i8;
fn truncate_buffer(buf: &Buffer<u8>) -> Buffer<u8> {
// * 2, as it must be able to hold u32::MAX offset + u32::MAX len.
buf.clone()
.sliced(0, std::cmp::min(buf.len(), OffsetType::MAX as usize * 2))
.sliced(0, std::cmp::min(buf.len(), ((OffsetType::MAX as u64) * 2) as usize))
}

pub fn binary_to_binview<O: Offset>(arr: &BinaryArray<O>) -> BinaryViewArray {
Expand Down

0 comments on commit 3661646

Please sign in to comment.