/// Check if a type matches this requirement.
Check if a type matches this requirement.
Check if a type matches this requirement .
pub fn matches(&self, ty: &Ty) -> bool {
        match *self {
            TypeReq::Any => true,
            TypeReq::One(req) => are_types_matching(req, ty),
            TypeReq::Many(ref reqs) => reqs.iter().any(|&req| are_types_matching(req, ty)),
        }
    }
pub fn matches ( & self , ty : & Ty ) -> bool { match * self { TypeReq :: Any => true , TypeReq :: One ( req ) => are_types_matching ( req , ty ) , TypeReq :: Many ( ref reqs ) => reqs . iter ( ) . any ( | & req | are_types_matching ( req , ty ) ) , } }
Check if a type matches this requirement.
Check if a type matches this requirement .
&self
ty
&Ty