luaur-cli-lib 0.1.2

Shared CLI helpers for the luaur tools.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub fn join_paths_basic_string_ch_ch_ch(str: &mut alloc::string::String, lhs: &str, rhs: &str) {
    *str = lhs.to_string();
    if !str.is_empty()
        && str.as_bytes().last() != Some(&b'/')
        && str.as_bytes().last() != Some(&b'\\')
        && !rhs.is_empty()
        && rhs.as_bytes().first() != Some(&b'/')
        && rhs.as_bytes().first() != Some(&b'\\')
    {
        str.push('/');
    }
    str.push_str(rhs);
}