#[cfg(test)]
pub(crate) mod example_generator;
pub(crate) mod token_helper;
pub(crate) fn make_whitespace_visible<S: AsRef<str>>(v: S) -> String {
let result: String = v
.as_ref()
.chars()
.map(|c| match c {
' ' => '␣',
'\n' => '↵',
_ => c,
})
.collect();
result
}
pub(crate) fn strip_module_header(full_config: &str) -> anyhow::Result<String> {
let parsed = toml::from_str::<toml::Table>(full_config)?;
if let Some(config) = parsed.get("config") {
let result = toml::to_string_pretty(config)?;
Ok(result)
} else {
Ok("".to_string())
}
}