From d857cee67caf555fedae54522ffd58429f7ee722 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 26 Apr 2024 11:23:27 -0400 Subject: [PATCH] Add safety justification comment --- arrow-cast/src/cast/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arrow-cast/src/cast/mod.rs b/arrow-cast/src/cast/mod.rs index 8b1b97561e25..b5b45f98feab 100644 --- a/arrow-cast/src/cast/mod.rs +++ b/arrow-cast/src/cast/mod.rs @@ -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::::new_unchecked( ScalarBuffer::new(views_builder.finish(), 0, len),