fn segment_input(tts: TokenStream) -> Vec<Vec<TokenTree>> {
    let mut groups = vec![];

    let mut group = vec![];

    for tt in tts {
        match tt {
            TokenTree::Punct(p)
                if p.as_char() == ',' && p.spacing() == Spacing::Alone =>
            {
                groups.push(group);
                group = vec![];
            }
            t => group.push(t),
        }
    }

    if !group.is_empty() {
        groups.push(group);
    }

    groups
}
// The tokenstream can contain multiple expressions to be checked, separated by
// a comma. This function "pulls" those expressions apart.
The tokenstream can contain multiple expressions to be checked, separated by
a comma. This function "pulls" those expressions apart.
The tokenstream can contain multiple expressions to be checked separated by a comma . This function " pulls " those expressions apart .
fn segment_input(tts: TokenStream) -> Vec<Vec<TokenTree>> {
    let mut groups = vec![];
    let mut group = vec![];
    for tt in tts {
        match tt {
            TokenTree::Punct(p)
                if p.as_char() == ',' && p.spacing() == Spacing::Alone =>
            {
                groups.push(group);
                group = vec![];
            }
            t => group.push(t),
        }
    }
    if !group.is_empty() {
        groups.push(group);
    }
    groups
}
fn segment_input ( tts : TokenStream ) -> Vec < Vec < TokenTree > > { let mut groups = vec ! [ ] ; let mut group = vec ! [ ] ; for tt in tts { match tt { TokenTree :: Punct ( p ) if p . as_char ( ) == ',' && p . spacing ( ) == Spacing :: Alone => { groups . push ( group ) ; group = vec ! [ ] ; } t => group . push ( t ) , } } if ! group . is_empty ( ) { groups . push ( group ) ; } groups }
The tokenstream can contain multiple expressions to be checked, separated by
a comma.
The tokenstream can contain multiple expressions to be checked separated by a comma .
tts
TokenStream
tts
TokenStream