const UNRAWABLE: [&str; 4] = ["crate", "self", "Self", "super"];
const KEYWORDS: [&str; 51] = [
"abstract", "as", "async", "await", "become", "box", "break", "const", "continue", "crate",
"do", "dyn", "else", "enum", "extern", "false", "final", "fn", "for", "if", "impl", "in",
"let", "loop", "macro", "match", "mod", "move", "mut", "override", "priv", "pub", "ref",
"return", "self", "Self", "static", "struct", "super", "trait", "true", "try", "type",
"typeof", "unsafe", "unsized", "use", "virtual", "where", "while", "yield",
];
pub(super) fn escape(name: &str) -> String {
if UNRAWABLE.contains(&name) {
return format!("{name}_");
}
if KEYWORDS.contains(&name) {
return format!("r#{name}");
}
name.to_string()
}