Mercurial > hg
comparison rust/Cargo.lock @ 44143:7f86426fdd2c
rust-node: binary Node ID and conversion utilities
The choice of type makes sure that a `Node` has the exact
wanted size. We'll use a different type for prefixes.
Added dependency: hexadecimal conversion relies on the
`hex` crate.
The fact that sooner or later Mercurial is going to need
to change its hash sizes has been taken strongly in
consideration:
- the hash length is a constant, but that is not directly
exposed to callers. Changing the value of that constant
is the only thing to do to change the hash length (even
in unit tests)
- the code could be adapted to support several sizes of hashes,
if that turned out to be useful. To that effect, only the
size of a given `Node` is exposed in the public API.
- callers not involved in initial computation, I/O and FFI
are able to operate without a priori assumptions on the hash
size. The traits `FromHex` and `ToHex` have not been directly
implemented, so that the doc-comments explaining these
restrictions would stay really visible in `cargo doc`
Differential Revision: https://phab.mercurial-scm.org/D7788
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Wed, 22 Jan 2020 16:37:05 +0100 |
parents | 5ac243a92e37 |
children | 161958ebf73c |
comparison
equal
deleted
inserted
replaced
44142:63db6657d280 | 44143:7f86426fdd2c |
---|---|
122 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", | 122 "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", |
123 "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | 123 "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", |
124 ] | 124 ] |
125 | 125 |
126 [[package]] | 126 [[package]] |
127 name = "hex" | |
128 version = "0.4.0" | |
129 source = "registry+https://github.com/rust-lang/crates.io-index" | |
130 | |
131 [[package]] | |
127 name = "hg-core" | 132 name = "hg-core" |
128 version = "0.1.0" | 133 version = "0.1.0" |
129 dependencies = [ | 134 dependencies = [ |
130 "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | 135 "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", |
136 "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
131 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | 137 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
132 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | 138 "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
133 "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 139 "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", |
134 "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | 140 "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", |
135 "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 141 "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", |
481 "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" | 487 "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" |
482 "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" | 488 "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" |
483 "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" | 489 "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" |
484 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" | 490 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" |
485 "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" | 491 "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" |
492 "checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" | |
486 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" | 493 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" |
487 "checksum libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)" = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c" | 494 "checksum libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)" = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c" |
488 "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" | 495 "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" |
489 "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" | 496 "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" |
490 "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" | 497 "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" |