Skip to content

Commit b02b0c2

Browse files
GarmashAlexPratyush
andauthored
Refactor UInt Shr implementation (#169)
Co-authored-by: Pratyush Mishra <[email protected]>
1 parent 20ca153 commit b02b0c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/uint/shr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl<const N: usize, T: PrimUInt, F: PrimeField> UInt<N, T, F> {
1414
*a = b.clone();
1515
}
1616

17-
let value = self.value.and_then(|a| Some(a >> other));
17+
let value = self.value.map(|a| a >> other);
1818
Ok(Self { bits, value })
1919
} else {
2020
panic!("attempt to shift right with overflow")
@@ -53,7 +53,7 @@ impl<const N: usize, T: PrimUInt, F: PrimeField, T2: PrimUInt> Shr<T2> for UInt<
5353
}
5454
}
5555

56-
impl<'a, const N: usize, T: PrimUInt, F: PrimeField, T2: PrimUInt> Shr<T2> for &'a UInt<N, T, F> {
56+
impl<const N: usize, T: PrimUInt, F: PrimeField, T2: PrimUInt> Shr<T2> for &UInt<N, T, F> {
5757
type Output = UInt<N, T, F>;
5858

5959
#[tracing::instrument(target = "gr1cs", skip(self, other))]

0 commit comments

Comments
 (0)