Skip to content

Commit

Permalink
impl From<&Big[U]Int> for Big[U]Int
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed May 22, 2021
1 parent 125fbbd commit 40c32a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bigint.rs
Expand Up @@ -82,6 +82,13 @@ impl Clone for BigInt {
}
}

impl From<&BigUint> for BigUint {
#[inline]
fn from(value: &BigUint) -> Self {
value.clone()
}
}

impl hash::Hash for BigInt {
#[inline]
fn hash<H: hash::Hasher>(&self, state: &mut H) {
Expand Down
7 changes: 7 additions & 0 deletions src/biguint.rs
Expand Up @@ -55,6 +55,13 @@ impl Clone for BigUint {
}
}

impl From<&BigInt> for BigInt {
#[inline]
fn from(value: &BigInt) -> Self {
value.clone()
}
}

impl hash::Hash for BigUint {
#[inline]
fn hash<H: hash::Hasher>(&self, state: &mut H) {
Expand Down

0 comments on commit 40c32a8

Please sign in to comment.