Skip to content

Commit 4a0b768

Browse files
authored
Remove redundant unsafe in test (#12914)
Unsafe `StructArray::new_unchecked` is a more performant alternative to `StructArray::new`. In test code there is no benefit from using the unsafe code path.
1 parent a9b202c commit 4a0b768

File tree

1 file changed

+1
-1
lines changed
  • datafusion/common/src/scalar

1 file changed

+1
-1
lines changed

datafusion/common/src/scalar/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6603,7 +6603,7 @@ mod tests {
66036603
let not_nulls = not_nulls.finish();
66046604
let not_nulls = Some(NullBuffer::new(not_nulls));
66056605

6606-
let ar = unsafe { StructArray::new_unchecked(fields, arrays, not_nulls) };
6606+
let ar = StructArray::new(fields, arrays, not_nulls);
66076607
let s = ScalarValue::Struct(Arc::new(ar));
66086608

66096609
assert_eq!(s.to_string(), "{a:1,b:2}");

0 commit comments

Comments
 (0)