martin-g commented on PR #1651:
URL: https://github.com/apache/avro/pull/1651#issuecomment-1106731745

   Runtime!
   I wasn't aware that quoted code is executed at runtime!
   
   Quick try didn't work. Again complains about ToTokens...
   
   
   On Fri, Apr 22, 2022, 03:44 Jack Klamer ***@***.***> wrote:
   
   > ***@***.**** commented on this pull request.
   >
   > 👍 Nice! great testing too.
   > ------------------------------
   >
   > In lang/rust/avro_derive/src/lib.rs
   > <https://github.com/apache/avro/pull/1651#discussion_r855686031>:
   >
   > >                      
FieldOptions::from_attributes(&field.attrs[..]).map_err(darling_to_syn)?;
   >
   > -                let doc = preserve_optional(field_documented.doc);
   >
   > +                let doc = preserve_optional(field_attrs.doc);
   >
   > +                let default_value = match field_attrs.default {
   >
   > +                    Some(default_value) => {
   >
   > +                        quote! {
   >
   >
   > NIT: I would prefer to run serde_json::from_str(#default_value) here and
   > throw an error if invalid. To avoid runtime errors.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/avro/pull/1651#pullrequestreview-949335544>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AABYUQVSSLLUFT5F3FOVSSLVGHZADANCNFSM5TZSKMKQ>
   > .
   > You are receiving this because you modified the open/close state.Message
   > ID: ***@***.***>
   >
   


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