fn add_where_clauses<'a, F, I>(where_clause: &mut Option<WhereClause>, generics: I, mut clause: F)
where
    F: FnMut(Ident) -> WherePredicate,
    I: IntoIterator<Item = &'a GenericParam>,
{
    let preds = &mut where_clause.get_or_insert(parse_quote!(where)).predicates;
    for generic in generics {
        if let GenericParam::Type(ty_param) = generic {
            let ty_param = ty_param.ident.clone();
            preds.push(clause(ty_param));
        }
    }
}
/// Adds where clause for each type parameter
Adds where clause for each type parameter
Adds where clause for each type parameter
fn add_where_clauses<'a, F, I>(where_clause: &mut Option<WhereClause>, generics: I, mut clause: F)
where
    F: FnMut(Ident) -> WherePredicate,
    I: IntoIterator<Item = &'a GenericParam>,
{
    let preds = &mut where_clause.get_or_insert(parse_quote!(where)).predicates;
    for generic in generics {
        if let GenericParam::Type(ty_param) = generic {
            let ty_param = ty_param.ident.clone();
            preds.push(clause(ty_param));
        }
    }
}
fn add_where_clauses < ' a , F , I > ( where_clause : & mut Option < WhereClause > , generics : I , mut clause : F ) where F : FnMut ( Ident ) -> WherePredicate , I : IntoIterator < Item = & ' a GenericParam > , { let preds = & mut where_clause . get_or_insert ( parse_quote ! ( where ) ) . predicates ; for generic in generics { if let GenericParam :: Type ( ty_param ) = generic { let ty_param = ty_param . ident . clone ( ) ; preds . push ( clause ( ty_param ) ) ; } } }
Adds where clause for each type parameter
Adds where clause for each type parameter
where_clause
&mut Option<WhereClause>
generics
I
clause
F