etcdv3client 0.3.0-beta.2

a simple etcdv3 client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub fn build_prefix_end(prefix: impl AsRef<[u8]>) -> Vec<u8> {
    let no_prefix_end = Vec::new();

    if prefix.as_ref().is_empty() {
        return no_prefix_end;
    }

    let mut end = prefix.as_ref().to_vec();

    for i in (0..end.len()).rev() {
        if end[i] < 0xff {
            end[i] += 1;
            return end[0..=i].to_vec();
        }
    }

    no_prefix_end
}