kissreplace 0.1.3

KISS template engine for @VAR@ placeholders
Documentation
1
2
3
4
5
6
7
8
pub fn is_valid_var_name(name: &str) -> bool {
    if name.is_empty() {
        return false;
    }
    let mut chars = name.chars();
    let first = chars.next().unwrap();
    (first.is_alphabetic() || first == '_') && chars.all(|c| c.is_alphanumeric() || c == '_')
}