Skip to content

Commit ddb35fb

Browse files
committed
Use new from_raw() APIs
1 parent ec8b22e commit ddb35fb

File tree

1 file changed

+2
-2
lines changed
  • arrow-integration-testing/src

1 file changed

+2
-2
lines changed

arrow-integration-testing/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn cdata_integration_import_schema_and_compare_to_json(
205205
let json_schema = read_json_file_metadata(json_name.to_str()?)?.schema;
206206

207207
// The source ArrowSchema will be released when this is dropped
208-
let imported_schema = unsafe { std::ptr::replace(c_schema, FFI_ArrowSchema::empty()) };
208+
let imported_schema = unsafe { FFI_ArrowSchema::from_raw(c_schema) };
209209
let imported_schema = Schema::try_from(&imported_schema)?;
210210

211211
// compare schemas
@@ -244,7 +244,7 @@ fn cdata_integration_import_batch_and_compare_to_json(
244244
read_single_batch_from_json_file(json_name.to_str()?, batch_num.try_into().unwrap())?;
245245
let schema = json_batch.schema();
246246

247-
let imported_array = unsafe { std::ptr::replace(c_array, FFI_ArrowArray::empty()) };
247+
let imported_array = unsafe { FFI_ArrowArray::from_raw(c_array) };
248248
let imported_array =
249249
from_ffi_and_data_type(imported_array, DataType::Struct(schema.fields.clone()))?;
250250
imported_array.validate_full()?;

0 commit comments

Comments
 (0)