alamb commented on code in PR #8489:
URL: https://github.com/apache/arrow-rs/pull/8489#discussion_r2389023745


##########
arrow-schema/src/ffi.rs:
##########
@@ -585,22 +598,14 @@ impl TryFrom<&FFI_ArrowSchema> for DataType {
                     ["tsm", ""] => DataType::Timestamp(TimeUnit::Millisecond, 
None),
                     ["tsu", ""] => DataType::Timestamp(TimeUnit::Microsecond, 
None),
                     ["tsn", ""] => DataType::Timestamp(TimeUnit::Nanosecond, 
None),
-                    ["tss", tz] => {
-                        DataType::Timestamp(TimeUnit::Second, 
Some(Arc::from(*tz)))
-                    }
-                    ["tsm", tz] => {
-                        DataType::Timestamp(TimeUnit::Millisecond, 
Some(Arc::from(*tz)))
-                    }
-                    ["tsu", tz] => {
-                        DataType::Timestamp(TimeUnit::Microsecond, 
Some(Arc::from(*tz)))
-                    }
-                    ["tsn", tz] => {
-                        DataType::Timestamp(TimeUnit::Nanosecond, 
Some(Arc::from(*tz)))
-                    }
+                    ["tss", tz] => DataType::Timestamp(TimeUnit::Second, 
Some(Arc::from(*tz))),

Review Comment:
   the choice of what rustfmt redoes seems somewhat arbitrary, but reasonable 
to me



##########
arrow-schema/src/ffi.rs:
##########
@@ -98,20 +98,20 @@ unsafe extern "C" fn release_schema(schema: *mut 
FFI_ArrowSchema) {
     if schema.is_null() {
         return;
     }
-    let schema = &mut *schema;
+    let schema = unsafe { &mut *schema };

Review Comment:
   It seems unfortunate to have to annotate every unsafe function call. I 
wonder if it is possible to mark the whole block unsafe, like the following:
   
   ```rust
   unsafe { 
     // do unsafe things here
   }
   ```
   



-- 
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