fn where_predicates_mut(
    item: &mut syn::Item,
) -> Option<&mut Punctuated<syn::WherePredicate, Token![,]>> {
    use syn::Item::*;
    let span = item.span();
    let maybe_where = match item {
        Fn(i) => &mut i.sig.generics.where_clause,
        Enum(i) => &mut i.generics.where_clause,
        Impl(i) => &mut i.generics.where_clause,
        Struct(i) => &mut i.generics.where_clause,
        Trait(i) => &mut i.generics.where_clause,
        TraitAlias(i) => &mut i.generics.where_clause,
        Type(i) => &mut i.generics.where_clause,
        Union(i) => &mut i.generics.where_clause,
        _ => return None,
    };
    if let Some(where_clause) = maybe_where {
        Some(&mut where_clause.predicates)
    } else {
        let clause = syn::WhereClause {
            where_token: syn::token::Where { span },
            predicates: Punctuated::new(),
        };
        *maybe_where = Some(clause);
        Some(&mut maybe_where.as_mut().unwrap().predicates)
    }
}
/// Get a mutable reference to the `where` predicates of an item, if the item supports `where`
/// predicates. Creates empty `where` clause if none exists yet.
Get a mutable reference to the `where` predicates of an item, if the item supports `where`
predicates. Creates empty `where` clause if none exists yet.
Get a mutable reference to the ` where ` predicates of an item if the item supports ` where ` predicates . Creates empty ` where ` clause if none exists yet .
fn where_predicates_mut(
    item: &mut syn::Item,
) -> Option<&mut Punctuated<syn::WherePredicate, Token![,]>> {
    use syn::Item::*;
    let span = item.span();
    let maybe_where = match item {
        Fn(i) => &mut i.sig.generics.where_clause,
        Enum(i) => &mut i.generics.where_clause,
        Impl(i) => &mut i.generics.where_clause,
        Struct(i) => &mut i.generics.where_clause,
        Trait(i) => &mut i.generics.where_clause,
        TraitAlias(i) => &mut i.generics.where_clause,
        Type(i) => &mut i.generics.where_clause,
        Union(i) => &mut i.generics.where_clause,
        _ => return None,
    };
    if let Some(where_clause) = maybe_where {
        Some(&mut where_clause.predicates)
    } else {
        let clause = syn::WhereClause {
            where_token: syn::token::Where { span },
            predicates: Punctuated::new(),
        };
        *maybe_where = Some(clause);
        Some(&mut maybe_where.as_mut().unwrap().predicates)
    }
}
fn where_predicates_mut ( item : & mut syn :: Item , ) -> Option < & mut Punctuated < syn :: WherePredicate , Token ! [ ] > > { use syn :: Item :: * ; let span = item . span ( ) ; let maybe_where = match item { Fn ( i ) => & mut i . sig . generics . where_clause , Enum ( i ) => & mut i . generics . where_clause , Impl ( i ) => & mut i . generics . where_clause , Struct ( i ) => & mut i . generics . where_clause , Trait ( i ) => & mut i . generics . where_clause , TraitAlias ( i ) => & mut i . generics . where_clause , Type ( i ) => & mut i . generics . where_clause , Union ( i ) => & mut i . generics . where_clause , _ => return None , } ; if let Some ( where_clause ) = maybe_where { Some ( & mut where_clause . predicates ) } else { let clause = syn :: WhereClause { where_token : syn :: token :: Where { span } , predicates : Punctuated :: new ( ) , } ; * maybe_where = Some ( clause ) ; Some ( & mut maybe_where . as_mut ( ) . unwrap ( ) . predicates ) } }
Get a mutable reference to the `where` predicates of an item, if the item supports `where`
predicates.
Get a mutable reference to the ` where ` predicates of an item if the item supports ` where ` predicates .
item
&mut syn::Item