sapling/rust
Jun Wu 090171ada4 vlqencoding: encodes integers to variable-length byte arrays
This is a common technique to store variable-length integers efficiently.
It's compatible with both Thrift and Protobuf [1].

It's intended to be used in:

  - On-disk file format to make the file compact and avoid issues like
    https://bz.mercurial-scm.org/5681 (Obsolete markers code crashes with
    metadata keys/values longer than 255 bytes).
  - Thrift layer.

[1]: https://developers.google.com/protocol-buffers/docs/encoding#varints

Test Plan:
```
cargo test
cargo clippy
```

Also ran a kcov coverage check and it says 100%.

```
cargo rustc --lib --profile test -- -Ccodegen-units=1 -Clink-dead-code -Zno-landing-pads
kcov --include-path $PWD/src --verify target/kcov ./target/debug/*-????????????????
```

Differential Revision: https://phab.mercurial-scm.org/D929
2017-11-10 12:12:04 -07:00
..
vlqencoding vlqencoding: encodes integers to variable-length byte arrays 2017-11-10 12:12:04 -07:00
.hgignore vlqencoding: encodes integers to variable-length byte arrays 2017-11-10 12:12:04 -07:00