pub fn replace_type<M, R>(ty: &mut Type, matcher: M, replacer: R)where
    M: Fn(&Type) -> bool,
    R: Fn(&mut Type) -> Option<Type>,
Expand description

Replaces all types which matches matcher with replacer.

  • replacer is called iff matcher returns true.

  • matcher is optimization, and it should not be recursive because replace_type invokes it recursively.