diff --git a/firewood/src/hashednode.rs b/firewood/src/hashednode.rs index a4c87bbfb..b6a1457d4 100644 --- a/firewood/src/hashednode.rs +++ b/firewood/src/hashednode.rs @@ -309,10 +309,10 @@ impl HasUpdate for Vec { impl HashedNodeStore { /// Returns the serialized representation of `node` used as the pre-image /// when hashing the node. The node is at the given `path_prefix`. - pub fn serialize_for_hashing(&self, node: &Node, path_prefix: &Path) -> Vec { + pub fn serialize_for_hashing(&self, node: &Node, path_prefix: &Path) -> Box<[u8]> { let mut hasher = vec![]; self.hash_internal_with(node, path_prefix, &mut hasher); - hasher + hasher.into_boxed_slice() } // hash a node