Skip to content

Commit

Permalink
Use ptr::write
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Nov 16, 2023
1 parent 55af164 commit 80b71cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arrow-integration-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand All @@ -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(())
}

Expand Down

0 comments on commit 80b71cd

Please sign in to comment.