rewrite_unary_call_balanced

Function rewrite_unary_call_balanced 

Source
pub(crate) fn rewrite_unary_call_balanced<F>(
    src: &str,
    name: &str,
    make_replacement: F,
) -> String
where F: Fn(&str) -> String,
Expand description

Generic paren-balanced rewriter for <name>(<single-arg>) calls. Walks the source, finds <name> on a word boundary followed by (, balances to the matching ), and replaces the whole call with make_replacement applied to the captured argument text (verbatim, not trimmed).