martin-g commented on code in PR #448:
URL: https://github.com/apache/avro-rs/pull/448#discussion_r2746328833


##########
avro_derive/src/lib.rs:
##########
@@ -81,14 +94,19 @@ fn derive_avro_schema(input: DeriveInput) -> 
Result<TokenStream, Vec<syn::Error>
 fn create_trait_definition(
     ident: Ident,
     generics: &Generics,
-    implementation: TokenStream,
+    get_schema_impl: TokenStream,
+    get_record_fields_impl: TokenStream,
 ) -> TokenStream {
     let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
     quote! {
         #[automatically_derived]
         impl #impl_generics apache_avro::AvroSchemaComponent for #ident 
#ty_generics #where_clause {
             fn get_schema_in_ctxt(named_schemas: &mut 
apache_avro::schema::Names, enclosing_namespace: &Option<String>) -> 
apache_avro::schema::Schema {
-                #implementation
+                #get_schema_impl
+            }
+
+            fn get_record_fields_in_ctxt(mut field_position: usize, 
named_schemas: &mut apache_avro::schema::Names, enclosing_namespace: 
&Option<String>) -> Option<std::vec::Vec<apache_avro::schema::RecordField>> {

Review Comment:
   ```suggestion
               fn get_record_fields_in_ctxt(mut field_position: usize, 
named_schemas: &mut apache_avro::schema::Names, enclosing_namespace: 
&Option<String>) -> Option<::std::vec::Vec<::apache_avro::schema::RecordField>> 
{
   ```
   I think we need to add such "root" prefix for all types which are used 
inside `quote!( ... )`.
   In a follow-up PR.



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