pub fn optimize_string_replacement<'a>( template: &'a str, replacements: &HashMap<&str, &str>, ) -> Cow<'a, str>
Example of refactoring string replacement to use Cow