From 80b71cde470849661160042287b537f50b29085d Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 16 Nov 2023 10:32:49 +0100 Subject: [PATCH] Use ptr::write --- arrow-integration-testing/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arrow-integration-testing/src/lib.rs b/arrow-integration-testing/src/lib.rs index 641d55c79cec..f02ec16b0d97 100644 --- a/arrow-integration-testing/src/lib.rs +++ b/arrow-integration-testing/src/lib.rs @@ -179,7 +179,7 @@ fn cdata_integration_export_schema_from_json( let f = read_json_file_metadata(json_name.to_str()?)?; let c_schema = FFI_ArrowSchema::try_from(&f.schema)?; // Move exported schema into output struct - unsafe { ptr::replace(out, c_schema) }; + unsafe { ptr::write(out, c_schema) }; Ok(()) } @@ -193,7 +193,7 @@ fn cdata_integration_export_batch_from_json( let a = StructArray::from(b).into_data(); let c_array = FFI_ArrowArray::new(&a); // Move exported array into output struct - unsafe { ptr::replace(out, c_array) }; + unsafe { ptr::write(out, c_array) }; Ok(()) }