@@ -393,10 +393,10 @@ use std::{borrow::Cow, iter};
393393use proc_macro2:: TokenStream ;
394394use quote:: { quote, quote_spanned, ToTokens } ;
395395use syn:: {
396- punctuated:: Punctuated , spanned:: Spanned , Attribute , DataEnum , DataStruct , DataUnion ,
397- DeriveInput , Expr , ExprLit , ExprPath , Fields , FieldsNamed , FieldsUnnamed , Generics , Lit , Meta ,
398- Path , Token , Variant ,
396+ spanned:: Spanned , Attribute , DataEnum , DataStruct , DataUnion , DeriveInput , Expr , ExprLit ,
397+ ExprPath , Fields , FieldsNamed , FieldsUnnamed , Generics , Lit , Meta , Path , Result , Variant ,
399398} ;
399+ use util:: MetaListExt ;
400400
401401#[ cfg( feature = "zeroize" ) ]
402402use self :: attr:: ZeroizeFqs ;
@@ -476,16 +476,14 @@ pub fn derive_where(
476476}
477477
478478/// Convenient way to deal with [`Result`] for [`derive_where()`].
479- fn derive_where_internal ( mut item : DeriveInput ) -> Result < TokenStream , syn :: Error > {
479+ fn derive_where_internal ( mut item : DeriveInput ) -> Result < TokenStream > {
480480 let mut crate_ = None ;
481481
482482 // Search for `crate` option.
483483 for attr in & item. attrs {
484484 if attr. path ( ) . is_ident ( DERIVE_WHERE ) {
485485 if let Meta :: List ( list) = & attr. meta {
486- if let Ok ( nested) =
487- list. parse_args_with ( Punctuated :: < Meta , Token ! [ , ] > :: parse_terminated)
488- {
486+ if let Ok ( nested) = list. parse_non_empty_nested_metas ( ) {
489487 if nested. len ( ) == 1 {
490488 let meta = nested. into_iter ( ) . next ( ) . expect ( "unexpected empty list" ) ;
491489
0 commit comments