encode() and decode() both have failure modes if you pass in a source or destination buffer that is too small but the return type is usize for both encode() and decode().
The _with_offset() routines could likewise be removed, since slices in rust are very cheap.
These are the routines I'm using inline in desert but I considered using this varinteger first:
https://github.com/substack/desert/blob/46789f4af0e98afb80438cb80db573d0d8dbb630/src/lib.rs#L1020-L1054
encode()anddecode()both have failure modes if you pass in a source or destination buffer that is too small but the return type isusizefor bothencode()anddecode().The
_with_offset()routines could likewise be removed, since slices in rust are very cheap.These are the routines I'm using inline in desert but I considered using this varinteger first:
https://github.com/substack/desert/blob/46789f4af0e98afb80438cb80db573d0d8dbb630/src/lib.rs#L1020-L1054