pub fn edit(
text: &str,
old: &str,
new: &str,
replace_all: bool,
) -> Result<String>Expand description
Replaces old with new in text.
The pattern must be present. When replace_all is false, the pattern must
occur exactly once so a caller cannot patch an unintended occurrence.