fn path_to_match_including_generics(ty: Ty, contextm: &racer::Match) -> Option<Ty> {
    return match ty {
        TyPathSearch(ref fieldtypepath, ref scope) => {

            if fieldtypepath.segments.len() == 1 {
                // could be a generic arg! - try and resolve it
                let ref typename = fieldtypepath.segments[0].name;
                let it = contextm.generic_args.iter()
                    .zip(contextm.generic_types.iter());
                for (name, typesearch) in it {
                    if name == typename {
                        // yes! a generic type match!
                        return find_type_match(&typesearch.path,
                                               &typesearch.filepath,
                                               typesearch.point);
                    }
                }
            }

            find_type_match(fieldtypepath, &scope.filepath, scope.point)
        }
        _ => Some(ty)
    };
}
// gets generics info from the context match
gets generics info from the context match
gets generics info from the context match
fn path_to_match_including_generics(ty: Ty, contextm: &racer::Match) -> Option<Ty> {
    return match ty {
        TyPathSearch(ref fieldtypepath, ref scope) => {
            if fieldtypepath.segments.len() == 1 {
                // could be a generic arg! - try and resolve it
                let ref typename = fieldtypepath.segments[0].name;
                let it = contextm.generic_args.iter()
                    .zip(contextm.generic_types.iter());
                for (name, typesearch) in it {
                    if name == typename {
                        // yes! a generic type match!
                        return find_type_match(&typesearch.path,
                                               &typesearch.filepath,
                                               typesearch.point);
                    }
                }
            }
            find_type_match(fieldtypepath, &scope.filepath, scope.point)
        }
        _ => Some(ty)
    };
}
fn path_to_match_including_generics ( ty : Ty , contextm : & racer :: Match ) -> Option < Ty > { return match ty { TyPathSearch ( ref fieldtypepath , ref scope ) => { if fieldtypepath . segments . len ( ) == 1 { // could be a generic arg! - try and resolve it let ref typename = fieldtypepath . segments [ 0 ] . name ; let it = contextm . generic_args . iter ( ) . zip ( contextm . generic_types . iter ( ) ) ; for ( name , typesearch ) in it { if name == typename { // yes! a generic type match! return find_type_match ( & typesearch . path , & typesearch . filepath , typesearch . point ) ; } } } find_type_match ( fieldtypepath , & scope . filepath , scope . point ) } _ => Some ( ty ) } ; }
gets generics info from the context match
gets generics info from the context match
ty
Ty
contextm
&racer::Match