Skip to content

Commit

Permalink
Add safety justification comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Apr 26, 2024
1 parent c0cc317 commit d857cee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arrow-cast/src/cast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,8 @@ where

assert_eq!(views_builder.len(), len);

/// Safety: the input was a valid array so the data was UTF8 (if string) and all offsets were valid
/// and we created the views correctly
Ok(Arc::new(unsafe {
GenericByteViewArray::<V>::new_unchecked(
ScalarBuffer::new(views_builder.finish(), 0, len),
Expand Down

0 comments on commit d857cee

Please sign in to comment.