fn compute_impl_bounds(&self) -> syn::Generics {
        if let Some(type_gen) = self.generics {
            let mut generics = type_gen.clone();

            if !self.pattern.requires_clone() || type_gen.ty_params.is_empty() {
                return generics;
            }
            
            let clone_bound = syn::TyParamBound::Trait(
                syn::PolyTraitRef {
                    trait_ref: syn::parse_path(self.bindings.clone_trait().as_str()).unwrap(),
                    bound_lifetimes: vec![],
                },
                syn::TraitBoundModifier::None
            );

            for mut typ in generics.ty_params.iter_mut() {
                typ.bounds.push(clone_bound.clone());
            }

            generics
        } else {
            Default::default()
        }
    }
/// Add `Clone` trait bound to generic types for non-owned builders.
/// This enables target types to declare generics without requiring a `Clone`
/// impl. This is the same as how the built-in derives for `Clone`, `Default`,
/// `PartialEq`, and other traits work.
Add `Clone` trait bound to generic types for non-owned builders.
This enables target types to declare generics without requiring a `Clone`
impl.
Add ` Clone ` trait bound to generic types for non - owned builders . This enables target types to declare generics without requiring a ` Clone ` impl .
fn compute_impl_bounds(&self) -> syn::Generics {
        if let Some(type_gen) = self.generics {
            let mut generics = type_gen.clone();
            if !self.pattern.requires_clone() || type_gen.ty_params.is_empty() {
                return generics;
            }
            let clone_bound = syn::TyParamBound::Trait(
                syn::PolyTraitRef {
                    trait_ref: syn::parse_path(self.bindings.clone_trait().as_str()).unwrap(),
                    bound_lifetimes: vec![],
                },
                syn::TraitBoundModifier::None
            );
            for mut typ in generics.ty_params.iter_mut() {
                typ.bounds.push(clone_bound.clone());
            }
            generics
        } else {
            Default::default()
        }
    }
fn compute_impl_bounds ( & self ) -> syn :: Generics { if let Some ( type_gen ) = self . generics { let mut generics = type_gen . clone ( ) ; if ! self . pattern . requires_clone ( ) || type_gen . ty_params . is_empty ( ) { return generics ; } let clone_bound = syn :: TyParamBound :: Trait ( syn :: PolyTraitRef { trait_ref : syn :: parse_path ( self . bindings . clone_trait ( ) . as_str ( ) ) . unwrap ( ) , bound_lifetimes : vec ! [ ] , } , syn :: TraitBoundModifier :: None ) ; for mut typ in generics . ty_params . iter_mut ( ) { typ . bounds . push ( clone_bound . clone ( ) ) ; } generics } else { Default :: default ( ) } }
Add `Clone` trait bound to generic types for non-owned builders.
Add ` Clone ` trait bound to generic types for non - owned builders .
&self
&self