jdarais commented on code in PR #382:
URL: https://github.com/apache/avro-rs/pull/382#discussion_r2659283156


##########
avro/src/schema.rs:
##########
@@ -134,7 +134,7 @@ pub enum Schema {
     /// An instant in local time represented as the number of nanoseconds 
after the UNIX epoch.
     LocalTimestampNanos,
     /// An amount of time defined by a number of months, days and milliseconds.
-    Duration,
+    Duration(FixedSchema),

Review Comment:
   I suspect that switching from `Duration(FixedSchema)` to 
`Duration(DurationSchema)` down the road may not be a whole lot more disruptive 
than starting with `Duration(DurationSchema)` and adding a new enum value down 
the road.  In the latter case, library consumers would still need to update 
match statements to accommodate the new enum variant, and nothing would have 
prevented consumers from writing code that assumes that duration is a fixed 
type.
   
   Admittedly, having to migrate consumer code from using a `FixedSchema` to 
using an enum would be slightly more disruptive, but I think it would be worth 
it to not have to deal with the extra enum layer for now.  Let me know what you 
think.



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