diff --git a/serde_codegen/src/bound.rs b/serde_codegen/src/bound.rs index ad973302..27b208b1 100644 --- a/serde_codegen/src/bound.rs +++ b/serde_codegen/src/bound.rs @@ -12,11 +12,11 @@ use syntax::visit; // allowed here". pub fn without_defaults(generics: &ast::Generics) -> ast::Generics { ast::Generics { - ty_params: generics.ty_params.map(|ty_param| { + ty_params: generics.ty_params.iter().map(|ty_param| { ast::TyParam { default: None, .. ty_param.clone() - }}), + }}).collect(), .. generics.clone() } }