rust-dirstate: use PARENT_SIZE constant where appropriate
authorYuya Nishihara <yuya@tcha.org>
Sat, 17 Aug 2019 13:55:05 +0900
changeset 42798 99dff4264524
parent 42797 1faa2bed47c6
child 42799 5399532510ae
rust-dirstate: use PARENT_SIZE constant where appropriate
rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs	Sat Aug 17 13:27:11 2019 +0900
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs	Sat Aug 17 13:55:05 2019 +0900
@@ -258,7 +258,7 @@
             return Ok(parents.clone());
         }
         let parents;
-        if file_contents.len() == 40 {
+        if file_contents.len() == PARENT_SIZE * 2 {
             parents = DirstateParents {
                 p1: copy_into_array(&file_contents[..PARENT_SIZE]),
                 p2: copy_into_array(