fn create_method_rename(method: &TraitItemMethod) -> TraitItemMethod {
        let mut m: TraitItemMethod = (*method).clone();

        // rename method and modify attributes
        {
            // remove any contracts attributes and rename
            let name = m.sig.ident.to_string();

            let new_name = contract_method_impl_name(&name);

            let mut new_attrs = vec![];
            new_attrs.push(syn::parse_quote!(#[doc(hidden)]));
            new_attrs.push(syn::parse_quote!(#[doc = "This is an internal function that is not meant to be used directly!"]));
            new_attrs.push(syn::parse_quote!(#[doc = "See the documentation of the `#[contract_trait]` attribute."]));

            // add all existing non-contract attributes
            new_attrs.extend(
                m.attrs
                    .iter()
                    .filter(|a| {
                        let name =
                            a.path.segments.last().unwrap().ident.to_string();

                        ContractType::contract_type_and_mode(&name).is_none()
                    })
                    .cloned(),
            );

            m.attrs = new_attrs;

            m.sig.ident = syn::Ident::new(&new_name, m.sig.ident.span());
        }

        m
    }
/// Just rename the method to have an internal, generated name.
Just rename the method to have an internal, generated name.
Just rename the method to have an internal generated name .
fn create_method_rename(method: &TraitItemMethod) -> TraitItemMethod {
        let mut m: TraitItemMethod = (*method).clone();
        // rename method and modify attributes
        {
            // remove any contracts attributes and rename
            let name = m.sig.ident.to_string();
            let new_name = contract_method_impl_name(&name);
            let mut new_attrs = vec![];
            new_attrs.push(syn::parse_quote!(#[doc(hidden)]));
            new_attrs.push(syn::parse_quote!(#[doc = "This is an internal function that is not meant to be used directly!"]));
            new_attrs.push(syn::parse_quote!(#[doc = "See the documentation of the `#[contract_trait]` attribute."]));
            // add all existing non-contract attributes
            new_attrs.extend(
                m.attrs
                    .iter()
                    .filter(|a| {
                        let name =
                            a.path.segments.last().unwrap().ident.to_string();
                        ContractType::contract_type_and_mode(&name).is_none()
                    })
                    .cloned(),
            );
            m.attrs = new_attrs;
            m.sig.ident = syn::Ident::new(&new_name, m.sig.ident.span());
        }
        m
    }
fn create_method_rename ( method : & TraitItemMethod ) -> TraitItemMethod { let mut m : TraitItemMethod = ( * method ) . clone ( ) ; // rename method and modify attributes { // remove any contracts attributes and rename let name = m . sig . ident . to_string ( ) ; let new_name = contract_method_impl_name ( & name ) ; let mut new_attrs = vec ! [ ] ; new_attrs . push ( syn :: parse_quote ! ( [ doc ( hidden ) ] ) ) ; new_attrs . push ( syn :: parse_quote ! ( [ doc " " ] ) ) ; new_attrs . push ( syn :: parse_quote ! ( [ doc " " ] ) ) ; // add all existing non-contract attributes new_attrs . extend ( m . attrs . iter ( ) . filter ( | a | { let name = a . path . segments . last ( ) . unwrap ( ) . ident . to_string ( ) ; ContractType :: contract_type_and_mode ( & name ) . is_none ( ) } ) . cloned ( ) , ) ; m . attrs = new_attrs ; m . sig . ident = syn :: Ident :: new ( & new_name , m . sig . ident . span ( ) ) ; } m }
Just rename the method to have an internal, generated name.
Just rename the method to have an internal generated name .
method
&TraitItemMethod
method
&TraitItemMethod