pub fn build_variant_arguments(
    structs_tuple: (Option<&Field>, Option<&Field>, Option<&Field>),
) -> TokenStream {
    // Todo this code is ugly, need to find something better
    match structs_tuple {
        (id, query, children) if id.is_some() && query.is_some() && children.is_some() => {
            quote! { id,query,children}
        }

        (id, query, children) if id.is_some() && query.is_some() && children.is_none() => {
            quote! { id, query}
        }
        (id, query, children) if id.is_none() && query.is_some() && children.is_some() => {
            quote! { query , children}
        }
        (id, query, children) if id.is_some() && children.is_some() && query.is_none() => {
            quote! { id, children }
        }
        (id, query, children) if id.is_some() && query.is_none() && children.is_none() => {
            quote! { id }
        }
        (id, query, children) if query.is_some() && id.is_none() && children.is_none() => {
            quote! { query}
        }
        (id, query, children) if query.is_none() && id.is_none() & children.is_some() => {
            quote! { children }
        }

        (id, query, children) if query.is_none() && id.is_none() & children.is_none() => {
            quote! {}
        }
        (_, _, _) => {
            quote! {}
        }
    }
}
/// Rebuild the content of a variant depending of the fields present in the
/// original enum
Rebuild the content of a variant depending of the fields present in the
original enum
Rebuild the content of a variant depending of the fields present in the original enum
pub fn build_variant_arguments(
    structs_tuple: (Option<&Field>, Option<&Field>, Option<&Field>),
) -> TokenStream {
    // Todo this code is ugly, need to find something better
    match structs_tuple {
        (id, query, children) if id.is_some() && query.is_some() && children.is_some() => {
            quote! { id,query,children}
        }
        (id, query, children) if id.is_some() && query.is_some() && children.is_none() => {
            quote! { id, query}
        }
        (id, query, children) if id.is_none() && query.is_some() && children.is_some() => {
            quote! { query , children}
        }
        (id, query, children) if id.is_some() && children.is_some() && query.is_none() => {
            quote! { id, children }
        }
        (id, query, children) if id.is_some() && query.is_none() && children.is_none() => {
            quote! { id }
        }
        (id, query, children) if query.is_some() && id.is_none() && children.is_none() => {
            quote! { query}
        }
        (id, query, children) if query.is_none() && id.is_none() & children.is_some() => {
            quote! { children }
        }
        (id, query, children) if query.is_none() && id.is_none() & children.is_none() => {
            quote! {}
        }
        (_, _, _) => {
            quote! {}
        }
    }
}
pub fn build_variant_arguments ( structs_tuple : ( Option < & Field > , Option < & Field > , Option < & Field > ) , ) -> TokenStream { // Todo this code is ugly, need to find something better match structs_tuple { ( id , query , children ) if id . is_some ( ) && query . is_some ( ) && children . is_some ( ) => { quote ! { id query children } } ( id , query , children ) if id . is_some ( ) && query . is_some ( ) && children . is_none ( ) => { quote ! { id query } } ( id , query , children ) if id . is_none ( ) && query . is_some ( ) && children . is_some ( ) => { quote ! { query children } } ( id , query , children ) if id . is_some ( ) && children . is_some ( ) && query . is_none ( ) => { quote ! { id children } } ( id , query , children ) if id . is_some ( ) && query . is_none ( ) && children . is_none ( ) => { quote ! { id } } ( id , query , children ) if query . is_some ( ) && id . is_none ( ) && children . is_none ( ) => { quote ! { query } } ( id , query , children ) if query . is_none ( ) && id . is_none ( ) & children . is_some ( ) => { quote ! { children } } ( id , query , children ) if query . is_none ( ) && id . is_none ( ) & children . is_none ( ) => { quote ! { } } ( _ , _ , _ ) => { quote ! { } } } }
Rebuild the content of a variant depending of the fields present in the
original enum
Rebuild the content of a variant depending of the fields present in the original enum
structs_tuple
(Option<&Field>, Option<&Field>, Option<&Field>)
structs_tuple
(Option<&Field>, Option<&Field>, Option<&Field>)