diff --git a/src/bigint.rs b/src/bigint.rs index 891eeb46..ab775f98 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -82,6 +82,13 @@ impl Clone for BigInt { } } +impl From<&BigInt> for BigInt { + #[inline] + fn from(value: &BigInt) -> Self { + value.clone() + } +} + impl hash::Hash for BigInt { #[inline] fn hash(&self, state: &mut H) { diff --git a/src/biguint.rs b/src/biguint.rs index 271a8837..c3f962cd 100644 --- a/src/biguint.rs +++ b/src/biguint.rs @@ -55,6 +55,13 @@ impl Clone for BigUint { } } +impl From<&BigUint> for BigUint { + #[inline] + fn from(value: &BigUint) -> Self { + value.clone() + } +} + impl hash::Hash for BigUint { #[inline] fn hash(&self, state: &mut H) {