From af8cf177cef941959c52cf23029b476143906e11 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 3 Mar 2019 20:08:27 +0100 Subject: [PATCH] ecaps2: Add a constructor. --- src/ecaps2.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ecaps2.rs b/src/ecaps2.rs index 352881f1..36e55c2c 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -28,6 +28,15 @@ generate_element!( impl PresencePayload for ECaps2 {} +impl ECaps2 { + /// Create an ECaps2 element from a list of hashes. + pub fn new(hashes: Vec) -> ECaps2 { + ECaps2 { + hashes, + } + } +} + fn compute_item(field: &str) -> Vec { let mut bytes = field.as_bytes().to_vec(); bytes.push(0x1f);