1 2 3 4 5 6 7 8 9 10 11 12
const RESTRICTED: [char; 9] = ['<', '>', ':', '"', '/', '\\', '|', '?', '*']; const REPLACEMENT: &str = "-"; pub struct Sanitizer; impl Sanitizer { #[must_use] pub fn execute(input: String) -> String { input.replace(&RESTRICTED[..], REPLACEMENT) } }