Rich-T-kid commented on code in PR #11932:
URL: https://github.com/apache/arrow-rs/pull/11932#discussion_r4497866807


##########
arrow-schema/src/ffi.rs:
##########
@@ -184,16 +183,30 @@ impl FFI_ArrowSchema {
         Ok(this)
     }
 
-    /// Set the name of the schema
-    pub fn with_name(mut self, name: &str) -> Result<Self, ArrowError> {
-        self.name = CString::new(name)
-            .map_err(|e| {
-                ArrowError::CDataInterface(format!(
-                    "Null byte at position {} not allowed in name",
-                    e.nul_position()
-                ))
-            })?
-            .into_raw();
+    /// Set the name of the schema.
+    ///
+    /// # Errors
+    ///
+    /// Returns an error if `name` contains an interior nul byte.
+    ///
+    /// # Safety
+    ///
+    /// `self` must be a live schema produced by this crate (e.g. via
+    /// [`FFI_ArrowSchema::try_new`] or a `TryFrom`), with its original
+    /// `private_data`. It must not be a foreign schema or
+    /// [`FFI_ArrowSchema::empty`]. This method interprets `private_data` as
+    /// this crate's private storage.
+    pub unsafe fn with_name(mut self, name: &str) -> Result<Self, ArrowError> {

Review Comment:
   this is a breaking change since callers will now need to add unsafe blocks.
   
   This is fine just pointing out



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to