From 50d5af63bc623c3208ac0a47430a78fe85310212 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Sat, 22 May 2021 14:36:03 -0500 Subject: [PATCH] impl From<&Big[U]Int> for Big[U]Int --- src/bigint.rs | 7 +++++++ src/biguint.rs | 7 +++++++ 2 files changed, 14 insertions(+) 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) {