Generic slice `replace`
Rust Internals [Unofficial]
April 25, 2026
It'd be nice if this were generic:
pub fn replace<P>(&self, from: P, to: &[T]) -> Vec<T>
where
P: Pattern
very related:
- Pre-RFC: New generic string pattern API for
&str
Discussion in the ATmosphere