libruskel 0.0.11

Generates skeletonized outlines of Rust crates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Identifier and keyword helpers used while rendering skeletons.

/// Rust reserved words that require raw identifier handling.
pub const RESERVED_WORDS: &[&str] = &[
    "abstract", "as", "become", "box", "break", "const", "continue", "crate", "do", "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",
];

/// Determine whether `ident` is a Rust keyword that needs escaping.
pub fn is_reserved_word(ident: &str) -> bool {
    RESERVED_WORDS.contains(&ident)
}