fn paren_elem_to_enum_literal(elem: &ast::ParenElem) -> Option<EnumLit> {
    if !elem.choices.value.is_empty() {
        None
    } else {
        match elem.expr.data {
            ast::NameExpr(ast::CompoundName {
                primary: ast::PrimaryName { kind, span, .. },
                ref parts,
                ..
            }) if parts.is_empty() => match kind {
                ast::PrimaryNameKind::Ident(n) => Some(EnumLit::Ident(Spanned::new(n, span))),
                ast::PrimaryNameKind::Char(c) => Some(EnumLit::Char(Spanned::new(c, span))),
                _ => None,
            },
            _ => None,
        }
    }
}
/// Unpack a parenthesis element as an enumeration literal.
Unpack a parenthesis element as an enumeration literal.
Unpack a parenthesis element as an enumeration literal .
fn paren_elem_to_enum_literal(elem: &ast::ParenElem) -> Option<EnumLit> {
    if !elem.choices.value.is_empty() {
        None
    } else {
        match elem.expr.data {
            ast::NameExpr(ast::CompoundName {
                primary: ast::PrimaryName { kind, span, .. },
                ref parts,
                ..
            }) if parts.is_empty() => match kind {
                ast::PrimaryNameKind::Ident(n) => Some(EnumLit::Ident(Spanned::new(n, span))),
                ast::PrimaryNameKind::Char(c) => Some(EnumLit::Char(Spanned::new(c, span))),
                _ => None,
            },
            _ => None,
        }
    }
}
fn paren_elem_to_enum_literal ( elem : & ast :: ParenElem ) -> Option < EnumLit > { if ! elem . choices . value . is_empty ( ) { None } else { match elem . expr . data { ast :: NameExpr ( ast :: CompoundName { primary : ast :: PrimaryName { kind , span , .. } , ref parts , .. } ) if parts . is_empty ( ) => match kind { ast :: PrimaryNameKind :: Ident ( n ) => Some ( EnumLit :: Ident ( Spanned :: new ( n , span ) ) ) , ast :: PrimaryNameKind :: Char ( c ) => Some ( EnumLit :: Char ( Spanned :: new ( c , span ) ) ) , _ => None , } , _ => None , } } }
Unpack a parenthesis element as an enumeration literal.
Unpack a parenthesis element as an enumeration literal .
elem
&ast::ParenElem
elem
&ast::ParenElem