scovich commented on code in PR #9454:
URL: https://github.com/apache/arrow-rs/pull/9454#discussion_r2874413328


##########
arrow-array/src/cast.rs:
##########
@@ -138,19 +138,19 @@ macro_rules! downcast_integer {
 /// [`DataType`]: arrow_schema::DataType
 #[macro_export]
 macro_rules! downcast_integer_array {
-    ($values:ident => $e:expr, $($p:pat $(if $pred:expr)* => $fallback:expr 
$(,)*)*) => {
-        $crate::downcast_integer_array!($values => {$e} $($p $(if $pred)* => 
$fallback)*)
+    ($values:ident => $e:expr, $($tail:tt)*) => {

Review Comment:
   yeah, that's why I wonder if it that surface was exposed accidentally as a 
side effect of the recursive macro complexity, rather than as an intentional 
design decision.
   
   My suggestion with three match arms was to be uniform:
   * Either claw it back (require either `value => ...` or `(value1, value2) => 
...` for both expressions and blocks
   * Or, fully implement it (allow both `value1, value2 => ...` and `(value1, 
value2) => ...` for both expressions and blocks



##########
arrow-array/src/cast.rs:
##########
@@ -138,19 +138,19 @@ macro_rules! downcast_integer {
 /// [`DataType`]: arrow_schema::DataType
 #[macro_export]
 macro_rules! downcast_integer_array {
-    ($values:ident => $e:expr, $($p:pat $(if $pred:expr)* => $fallback:expr 
$(,)*)*) => {
-        $crate::downcast_integer_array!($values => {$e} $($p $(if $pred)* => 
$fallback)*)
+    ($values:ident => $e:expr, $($tail:tt)*) => {

Review Comment:
   yeah, that's why I wonder if that surface was exposed accidentally as a side 
effect of the recursive macro complexity, rather than as an intentional design 
decision.
   
   My suggestion with three match arms was to be uniform:
   * Either claw it back (require either `value => ...` or `(value1, value2) => 
...` for both expressions and blocks
   * Or, fully implement it (allow both `value1, value2 => ...` and `(value1, 
value2) => ...` for both expressions and blocks



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