[
https://issues.apache.org/jira/browse/AVRO-3484?focusedWorklogId=761082&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-761082
]
ASF GitHub Bot logged work on AVRO-3484:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Apr/22 20:14
Start Date: 22/Apr/22 20:14
Worklog Time Spent: 10m
Work Description: martin-g commented on code in PR #1651:
URL: https://github.com/apache/avro/pull/1651#discussion_r856540773
##########
lang/rust/avro_derive/src/lib.rs:
##########
@@ -117,16 +119,24 @@ fn get_data_struct_schema_def(
syn::Fields::Named(ref a) => {
for (position, field) in a.named.iter().enumerate() {
let name = field.ident.as_ref().unwrap().to_string(); // we
know everything has a name
- let field_documented =
+ let field_attrs =
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! {
Review Comment:
I will need your help with this!
I changed it to:
```diff
diff --git lang/rust/avro_derive/src/lib.rs lang/rust/avro_derive/src/lib.rs
index 423625375..d8305452a 100644
-
Issue Time Tracking
-------------------
Worklog Id: (was: 761082)
Time Spent: 1h (was: 50m)
> Rust: Implement derive default via annotation
> ---------------------------------------------
>
> Key: AVRO-3484
> URL: https://issues.apache.org/jira/browse/AVRO-3484
> Project: Apache Avro
> Issue Type: Improvement
> Reporter: Jack Klamer
> Assignee: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.1, 1.12.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Origin Comment: https://github.com/apache/avro/pull/1631#discussion_r845826110
> Follow up on the avro derive work. Will want to be able to set the default
> for a field inside a struct using annotations
--
This message was sent by Atlassian Jira
(v8.20.7#820007)