From cc44711204b76ee70b23996b23017c3d790996c4 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 5 Oct 2020 23:28:32 -0400 Subject: [PATCH] Impl<'a> Sub<&'a ValueCommitment> for ValueCommitment --- zebra-chain/src/sapling/commitment.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zebra-chain/src/sapling/commitment.rs b/zebra-chain/src/sapling/commitment.rs index cc099d1a..9c806909 100644 --- a/zebra-chain/src/sapling/commitment.rs +++ b/zebra-chain/src/sapling/commitment.rs @@ -187,6 +187,14 @@ impl From for [u8; 32] { } } +impl<'a> std::ops::Sub<&'a ValueCommitment> for ValueCommitment { + type Output = Self; + + fn sub(self, rhs: &'a ValueCommitment) -> Self::Output { + self - *rhs + } +} + impl std::ops::Sub for ValueCommitment { type Output = Self;