pub fn expand_fields<F: FieldId + Clone, A: AggField<F>>(
    fields: &[DumpOptionField<F, A>],
    detail: bool,
) -> Vec<DumpField<F>> {
    let mut res = Vec::new();
    for field in fields {
        match field {
            DumpOptionField::Unit(field) => res.push(field.clone()),
            DumpOptionField::Agg(agg) => {
                res.extend(agg.expand(detail).into_iter().map(DumpField::FieldId))
            }
        }
    }
    res
}
/// Expand the Agg fields and collect them with other Unit fields.
Expand the Agg fields and collect them with other Unit fields.
Expand the Agg fields and collect them with other Unit fields .
pub fn expand_fields<F: FieldId + Clone, A: AggField<F>>(
    fields: &[DumpOptionField<F, A>],
    detail: bool,
) -> Vec<DumpField<F>> {
    let mut res = Vec::new();
    for field in fields {
        match field {
            DumpOptionField::Unit(field) => res.push(field.clone()),
            DumpOptionField::Agg(agg) => {
                res.extend(agg.expand(detail).into_iter().map(DumpField::FieldId))
            }
        }
    }
    res
}
pub fn expand_fields < F : FieldId + Clone , A : AggField < F > > ( fields : & [ DumpOptionField < F , A > ] , detail : bool , ) -> Vec < DumpField < F > > { let mut res = Vec :: new ( ) ; for field in fields { match field { DumpOptionField :: Unit ( field ) => res . push ( field . clone ( ) ) , DumpOptionField :: Agg ( agg ) => { res . extend ( agg . expand ( detail ) . into_iter ( ) . map ( DumpField :: FieldId ) ) } } } res }
Expand the Agg fields and collect them with other Unit fields.
Expand the Agg fields and collect them with other Unit fields .
fields
&[DumpOptionField<F, A>]
detail
bool
fields
&[DumpOptionField<F, A>]
detail
bool