You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2025/06/10 08:51:44 UTC

(avro-rs) branch add-automatically-derived-attribute created (now 77c8f5f)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a change to branch add-automatically-derived-attribute
in repository https://gitbox.apache.org/repos/asf/avro-rs.git


      at 77c8f5f  feat: Add `#[automatically_derived]` attribute to the auto generated impls

This branch includes the following new commits:

     new 77c8f5f  feat: Add `#[automatically_derived]` attribute to the auto generated impls

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(avro-rs) 01/01: feat: Add `#[automatically_derived]` attribute to the auto generated impls

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch add-automatically-derived-attribute
in repository https://gitbox.apache.org/repos/asf/avro-rs.git

commit 77c8f5fe89496fd57b9240727c27a76f84d0f932
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Tue Jun 10 11:51:00 2025 +0300

    feat: Add `#[automatically_derived]` attribute to the auto generated impls
    
    See https://doc.rust-lang.org/reference/attributes/derive.html#the-automatically_derived-attribute
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 avro_derive/src/lib.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/avro_derive/src/lib.rs b/avro_derive/src/lib.rs
index bf52f95..767a46a 100644
--- a/avro_derive/src/lib.rs
+++ b/avro_derive/src/lib.rs
@@ -112,6 +112,7 @@ fn derive_avro_schema(input: &mut DeriveInput) -> Result<TokenStream, Vec<syn::E
     let ident = &input.ident;
     let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
     Ok(quote! {
+        #[automatically_derived]
         impl #impl_generics apache_avro::schema::derive::AvroSchemaComponent for #ident #ty_generics #where_clause {
             fn get_schema_in_ctxt(named_schemas: &mut std::collections::HashMap<apache_avro::schema::Name, apache_avro::schema::Schema>, enclosing_namespace: &Option<String>) -> apache_avro::schema::Schema {
                 let name =  apache_avro::schema::Name::new(#full_schema_name).expect(&format!("Unable to parse schema name {}", #full_schema_name)[..]).fully_qualified_name(enclosing_namespace);
@@ -521,6 +522,7 @@ mod tests {
                 let derived = derive_avro_schema(&mut input);
                 assert!(derived.is_ok());
                 assert_eq!(derived.unwrap().to_string(), quote! {
+                    #[automatically_derived]
                     impl apache_avro::schema::derive::AvroSchemaComponent for Basic {
                         fn get_schema_in_ctxt(
                             named_schemas: &mut std::collections::HashMap<