MCPcopy Create free account
hub / github.com/apache/datafusion / replace_into_writer

Function replace_into_writer

datafusion/functions/src/string/replace.rs:286–294  ·  view source on GitHub ↗
(w: &mut W, string: &str, from: &str, to: &str)

Source from the content-addressed store, hash-verified

284
285#[inline]
286fn replace_into_writer<W: StringWriter>(w: &mut W, string: &str, from: &str, to: &str) {
287 let mut last_end = 0;
288 for (start, _part) in string.match_indices(from) {
289 w.write_str(&string[last_end..start]);
290 w.write_str(to);
291 last_end = start + from.len();
292 }
293 w.write_str(&string[last_end..]);
294}
295
296#[cfg(test)]
297mod tests {

Callers 1

apply_replaceFunction · 0.85

Calls 2

write_strMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…