pub fn flatten<'a>(&'a self, registry: &'a Registry) -> (Option<&'a str>, &'a TypeKind) {
        match self {
            &TypeKind::Primitive(ref p) => (Some(p.name()), self),
            &TypeKind::Named(ref s) => {
                if let &NamedType::Typedef(ref t) = registry.resolve_type(s) {
                    if !t.optional {
                        return (Some(s.as_str()), t.kind.flatten(registry).1);
                    }
                }
                (Some(s.as_str()), self)
            },
            _ => (None, self),
        }
    }
/// Look through type aliases to find the "real" definition of a type.
/// Also returns the "original name" if applicable.
Look through type aliases to find the "real" definition of a type.
Also returns the "original name" if applicable.
Look through type aliases to find the " real " definition of a type . Also returns the " original name " if applicable .
pub fn flatten<'a>(&'a self, registry: &'a Registry) -> (Option<&'a str>, &'a TypeKind) {
        match self {
            &TypeKind::Primitive(ref p) => (Some(p.name()), self),
            &TypeKind::Named(ref s) => {
                if let &NamedType::Typedef(ref t) = registry.resolve_type(s) {
                    if !t.optional {
                        return (Some(s.as_str()), t.kind.flatten(registry).1);
                    }
                }
                (Some(s.as_str()), self)
            },
            _ => (None, self),
        }
    }
pub fn flatten < ' a > ( & ' a self , registry : & ' a Registry ) -> ( Option < & ' a str > , & ' a TypeKind ) { match self { & TypeKind :: Primitive ( ref p ) => ( Some ( p . name ( ) ) , self ) , & TypeKind :: Named ( ref s ) => { if let & NamedType :: Typedef ( ref t ) = registry . resolve_type ( s ) { if ! t . optional { return ( Some ( s . as_str ( ) ) , t . kind . flatten ( registry ) . 1 ) ; } } ( Some ( s . as_str ( ) ) , self ) } , _ => ( None , self ) , } }
Look through type aliases to find the "real" definition of a type.
Look through type aliases to find the " real " definition of a type .
&'a self
registry
&'a Registry
&'a self
registry
&'a Registry