1
mod lock_macros;
2

            
3
306
pub fn next_string_sequence(string: &str) -> String {
4
306
    let mut bytes = string.as_bytes().to_vec();
5
306
    for (index, char) in string.char_indices().rev() {
6
306
        let mut next_char = u32::from(char) + 1;
7
306
        if next_char == 0xd800 {
8
            next_char = 0xE000;
9
306
        } else if next_char > u32::from(char::MAX) {
10
            continue;
11
306
        }
12

            
13
306
        let mut char_bytes = [0; 6];
14
306
        bytes.splice(
15
306
            index..,
16
306
            char::try_from(next_char)
17
306
                .unwrap()
18
306
                .encode_utf8(&mut char_bytes)
19
306
                .bytes(),
20
306
        );
21
306
        return String::from_utf8(bytes).unwrap();
22
    }
23

            
24
    String::default()
25
306
}