1
mod lock_macros;
2

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

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

            
24
    String::default()
25
450
}