diff rust/hg-core/src/revlog/node.rs @ 46595:98a455a62699

rust: Make `DirstateParents`’s fields typed `Node`s Instead of plain byte arrays. Differential Revision: https://phab.mercurial-scm.org/D10006
author Simon Sapin <simon.sapin@octobus.net>
date Wed, 17 Feb 2021 12:24:53 +0100
parents 43d63979a75e
children b1f2c2b336ec
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/node.rs	Wed Feb 17 12:06:56 2021 +0100
+++ b/rust/hg-core/src/revlog/node.rs	Wed Feb 17 12:24:53 2021 +0100
@@ -85,6 +85,13 @@
     }
 }
 
+impl From<&'_ NodeData> for Node {
+    #[inline]
+    fn from(data: &'_ NodeData) -> Self {
+        Self { data: *data }
+    }
+}
+
 impl fmt::LowerHex for Node {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         for &byte in &self.data {