Function tantivy_common::replace_in_place

source ·
pub fn replace_in_place(needle: u8, replacement: u8, bytes: &mut [u8])
Expand description

Replaces a given byte in the bytes slice of bytes.

This function assumes that the needle is rarely contained in the bytes string and offers a fast path if the needle is not present.