Skip to content

Commit 6ea256c

Browse files
committed
improve the macro rules for impl_primitive_form_variant for timestamp
1 parent 807ac5c commit 6ea256c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parquet-variant-compute/src/type_conversion.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro_rules! impl_primitive_from_variant {
5656
}
5757
}
5858
};
59-
($arrow_type:ty $(, $variant_method:ident => $cast_fn:expr )+ ) => {
59+
($arrow_type:ty, $( $variant_method:ident -> $cast_fn:expr ),+ $(,)?) => {
6060
impl TimestampFromVariant for $arrow_type {
6161
fn from_variant(variant: &Variant<'_, '_>) -> Option<Self::Native> {
6262
$(
@@ -88,11 +88,11 @@ impl_primitive_from_variant!(
8888
);
8989
impl_primitive_from_variant!(
9090
datatypes::TimestampMicrosecondType,
91-
as_timestamp_micros => |t| t);
91+
as_timestamp_micros -> |t| t);
9292
impl_primitive_from_variant!(
9393
datatypes::TimestampNanosecondType,
94-
as_timestamp_micros => |t| 1000 * t,
95-
as_timestamp_nanos => |t| t);
94+
as_timestamp_micros -> |t| 1000 * t,
95+
as_timestamp_nanos -> |t| t);
9696

9797
/// Convert the value at a specific index in the given array into a `Variant`.
9898
macro_rules! non_generic_conversion_single_value {

0 commit comments

Comments
 (0)