Skip to main content

rewrite_xl

Function rewrite_xl 

Source
pub fn rewrite_xl(
    code: &str,
    f: impl FnMut(&str) -> Option<String>,
) -> Option<String>
Expand description

Rewrites the reference of every xl("…") literal in code with f; None from f leaves it. Returns the new code when anything changed. A new reference holding the literal’s quote (a sheet name that needs quotes, 'Q4 2026'!B2) gets the other quote as its delimiter, or an escaped quote when it holds both, so it never ends the string early.