Function stc_ts_file_analyzer::ty::replace::replace_type
source · [−]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 iffmatcher
returnstrue
. -
matcher
is optimization, and it should not be recursive becausereplace_type
invokes it recursively.