pub fn build_number(bytes: &[u8]) -> (usize, usize) /* (index, eaten) */ {
    let mut i: usize = 0;
    let mut e = 0;
    let chunk = 0b1000_0000;

    for byte in bytes {
        // shift left by 7
        e += 1;
        i *= chunk as usize;

        // check if this byte is the last byte in the sequence
        // you pass remaining bytecode, so early breaking is important
        if byte >= &chunk {
            i += (byte - chunk) as usize;
            break;
        } else {
            i += *byte as usize;
        }
    }

    return (i, e);
}
This takes a stream of bytes, and builds the next number in it.
Note that this function tries to build a number no matter what,
even if the byte stream does not have a number, is empty, or ends after a
continue bit is set.
passerine-common/src/number.rs