@@ -76,9 +76,9 @@ pub(crate) trait TimestampFromVariant: ArrowTimestampType {
76
76
}
77
77
78
78
macro_rules! impl_timestamp_from_variant {
79
- ( $timestamp_type: ty, {
80
- $ ( ( $variant_pattern: pat, $conversion: expr) ) ,+ $( , ) ?
81
- } ) => {
79
+ ( $timestamp_type: ty,
80
+ $ ( $variant_pattern: pat => $conversion: expr ) ,+ $( , ) ?
81
+ ) => {
82
82
impl TimestampFromVariant for $timestamp_type {
83
83
fn from_variant( variant: & Variant <' _, ' _>) -> Option <Self :: Native > {
84
84
match variant {
@@ -92,17 +92,19 @@ macro_rules! impl_timestamp_from_variant {
92
92
} ;
93
93
}
94
94
95
- impl_timestamp_from_variant ! ( TimestampMicrosecondType , {
96
- ( Variant :: TimestampMicros ( t) , Some ( t. timestamp_micros( ) ) ) ,
97
- ( Variant :: TimestampNtzMicros ( t) , Some ( t. and_utc( ) . timestamp_micros( ) ) ) ,
98
- } ) ;
99
-
100
- impl_timestamp_from_variant ! ( TimestampNanosecondType , {
101
- ( Variant :: TimestampMicros ( t) , Some ( t. timestamp_micros( ) ) . map( |t| t * 1000 ) ) ,
102
- ( Variant :: TimestampNtzMicros ( t) , Some ( t. and_utc( ) . timestamp_micros( ) ) . map( |t| t * 1000 ) ) ,
103
- ( Variant :: TimestampNanos ( t) , t. timestamp_nanos_opt( ) ) ,
104
- ( Variant :: TimestampNtzNanos ( t) , t. and_utc( ) . timestamp_nanos_opt( ) ) ,
105
- } ) ;
95
+ impl_timestamp_from_variant ! (
96
+ TimestampMicrosecondType ,
97
+ Variant :: TimestampMicros ( t) => Some ( t. timestamp_micros( ) ) ,
98
+ Variant :: TimestampNtzMicros ( t) => Some ( t. and_utc( ) . timestamp_micros( ) ) ,
99
+ ) ;
100
+
101
+ impl_timestamp_from_variant ! (
102
+ TimestampNanosecondType ,
103
+ Variant :: TimestampMicros ( t) => Some ( t. timestamp_micros( ) ) . map( |t| t * 1000 ) ,
104
+ Variant :: TimestampNtzMicros ( t) => Some ( t. and_utc( ) . timestamp_micros( ) ) . map( |t| t * 1000 ) ,
105
+ Variant :: TimestampNanos ( t) => t. timestamp_nanos_opt( ) ,
106
+ Variant :: TimestampNtzNanos ( t) => t. and_utc( ) . timestamp_nanos_opt( ) ,
107
+ ) ;
106
108
107
109
/// Convert the value at a specific index in the given array into a `Variant`.
108
110
macro_rules! non_generic_conversion_single_value {
0 commit comments