luaur-cli-lib 0.1.1

Shared CLI helpers for the luaur tools.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
pub fn get_extension(path: &str) -> alloc::string::String {
    match path.rfind(['.', '\\', '/']) {
        Some(dot_index) => {
            if path.as_bytes()[dot_index] == b'.' {
                alloc::string::String::from(&path[dot_index..])
            } else {
                alloc::string::String::new()
            }
        }
        None => alloc::string::String::new(),
    }
}