pub fn num_args(r: &Repr, discr: Disr) -> uint {
    match *r {
        CEnum(..) => 0,
        Univariant(ref st, dtor) => {
            assert_eq!(discr, 0);
            st.fields.len() - (if dtor { 1 } else { 0 })
        }
        General(_, ref cases) => cases[discr].fields.len() - 1,
        NullablePointer{ nonnull: ref nonnull, nndiscr,
                         nullfields: ref nullfields, .. } => {
            if discr == nndiscr { nonnull.fields.len() } else { nullfields.len() }
        }
    }
}
/**
 * The number of fields in a given case; for use when obtaining this
 * information from the type or definition is less convenient.
 */
The number of fields in a given case; for use when obtaining this
information from the type or definition is less convenient.
The number of fields in a given case ; for use when obtaining this information from the type or definition is less convenient .
pub fn num_args(r: &Repr, discr: Disr) -> uint {
    match *r {
        CEnum(..) => 0,
        Univariant(ref st, dtor) => {
            assert_eq!(discr, 0);
            st.fields.len() - (if dtor { 1 } else { 0 })
        }
        General(_, ref cases) => cases[discr].fields.len() - 1,
        NullablePointer{ nonnull: ref nonnull, nndiscr,
                         nullfields: ref nullfields, .. } => {
            if discr == nndiscr { nonnull.fields.len() } else { nullfields.len() }
        }
    }
}
pub fn num_args ( r : & Repr , discr : Disr ) -> uint { match * r { CEnum ( .. ) => 0 , Univariant ( ref st , dtor ) => { assert_eq ! ( discr 0 ) ; st . fields . len ( ) - ( if dtor { 1 } else { 0 } ) } General ( _ , ref cases ) => cases [ discr ] . fields . len ( ) - 1 , NullablePointer { nonnull : ref nonnull , nndiscr , nullfields : ref nullfields , .. } => { if discr == nndiscr { nonnull . fields . len ( ) } else { nullfields . len ( ) } } } }
The number of fields in a given case; for use when obtaining this
 information from the type or definition is less convenient.
The number of fields in a given case ; for use when obtaining this information from the type or definition is less convenient .
r
&Repr
discr
Disr
r
&Repr
discr
Disr