• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::{Config, EmitMode};
2 use std::borrow::Cow;
3 
transform_missing_snippet<'a>(config: &Config, string: &'a str) -> Cow<'a, str>4 pub(crate) fn transform_missing_snippet<'a>(config: &Config, string: &'a str) -> Cow<'a, str> {
5     match config.emit_mode() {
6         EmitMode::Coverage => Cow::from(replace_chars(string)),
7         _ => Cow::from(string),
8     }
9 }
10 
replace_chars(s: &str) -> String11 fn replace_chars(s: &str) -> String {
12     s.chars()
13         .map(|ch| if ch.is_whitespace() { ch } else { 'X' })
14         .collect()
15 }
16