Commit 1f38a623 authored by Simon Sapin's avatar Simon Sapin
Browse files

dirstate-v2: Name a constant in the Rust implementation

We are about to introduce a Python version of this code that will also need
this constant.

Differential Revision: https://phab.mercurial-scm.org/D11547
parent 4d5a13253d34
Pipeline #27691 failed with stages
in 120 minutes and 10 seconds
......@@ -35,12 +35,14 @@ pub(super) type IgnorePatternsHash = [u8; IGNORE_PATTERNS_HASH_LEN];
/// `mercurial/dirstateutils/docket.py`
const TREE_METADATA_SIZE: usize = 44;
const NODE_SIZE: usize = 43;
/// Make sure that size-affecting changes are made knowingly
#[allow(unused)]
fn static_assert_size_of() {
let _ = std::mem::transmute::<TreeMetadata, [u8; TREE_METADATA_SIZE]>;
let _ = std::mem::transmute::<DocketHeader, [u8; TREE_METADATA_SIZE + 81]>;
let _ = std::mem::transmute::<Node, [u8; 43]>;
let _ = std::mem::transmute::<Node, [u8; NODE_SIZE]>;
}
// Must match `HEADER` in `mercurial/dirstateutils/docket.py`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment