jhorstmann commented on PR #8072:
URL: https://github.com/apache/arrow-rs/pull/8072#issuecomment-3165566978

   > I'd like the resulting rust enums to use unit variants for the empty 
structs just to cut down on code ugliness. I have a macro 
`thrift_union_all_empty` that does what I want for enums with all unit variants.
   
   Maybe the field type could be made optional in the macro definition like 
this:
   
   ```
   union LogicalType {
     1:  STRING // was StringType STRING
   ...
     5:  DecimalType DECIMAL // DecimalType contains scale and precision
   }
   ```
   
   But that looses the nice feature of being able to do a clean diff of 
everything inside the macro against the actual thrift definitions from the 
spec. I don't think a declarative macro could keep track that `StringType` 
(which could be defined anywhere) was an empty struct. The issue is similar to 
the one about lifetimes, ideally I'd want to generate a lifetime parameter if 
any of the fields need one.
   


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to