scovich opened a new pull request, #8519:
URL: https://github.com/apache/arrow-rs/pull/8519

   # Which issue does this PR close?
   
   - Relates to https://github.com/apache/arrow-rs/issues/8515
   - Relates to https://github.com/apache/arrow-rs/pull/8516
   
   # Rationale for this change
   
   The existing `VariantAsPrimitive` trait is kind of "backward" and requires 
very complex type bounds to use, e.g.:
   ```rust
   impl<'a, T> VariantToPrimitiveArrowRowBuilder<'a, T>
   where
       T: ArrowPrimitiveType,
       for<'m, 'v> Variant<'m, 'v>: VariantAsPrimitive<T>,
   ```
   
   This is a code smell.
   
   # What changes are included in this PR?
   
   "Reverse" the trait -- instead of extending `Variant`, the trait extends `T: 
ArrowPrimitiveType`. The resulting type bounds are much more intuitive:
   ```rust
   impl<'a, T: PrimitiveFromVariant> VariantToPrimitiveArrowRowBuilder<'a, T>
   ```
   
   # Are these changes tested?
   
   Existing unit tests cover this refactor.
   
   # Are there any user-facing changes?
   
   No.


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