Skip to content

Commit

Permalink
Update to rust master
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Dec 16, 2014
1 parent f299e33 commit 01a5d7c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/bn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,45 +407,45 @@ pub mod unchecked {
use ffi;
use super::{BigNum};

impl Add<BigNum, BigNum> for BigNum {
fn add(&self, oth: &BigNum) -> BigNum {
impl<'a> Add<&'a BigNum, BigNum> for &'a BigNum {
fn add(self, oth: &'a BigNum) -> BigNum {
self.checked_add(oth).unwrap()
}
}

impl Sub<BigNum, BigNum> for BigNum {
fn sub(&self, oth: &BigNum) -> BigNum {
impl<'a> Sub<&'a BigNum, BigNum> for &'a BigNum {
fn sub(self, oth: &'a BigNum) -> BigNum {
self.checked_sub(oth).unwrap()
}
}

impl Mul<BigNum, BigNum> for BigNum {
fn mul(&self, oth: &BigNum) -> BigNum {
impl<'a> Mul<&'a BigNum, BigNum> for &'a BigNum {
fn mul(self, oth: &'a BigNum) -> BigNum {
self.checked_mul(oth).unwrap()
}
}

impl Div<BigNum, BigNum> for BigNum {
fn div(&self, oth: &BigNum) -> BigNum {
impl<'a> Div<&'a BigNum, BigNum> for &'a BigNum {
fn div(self, oth: &'a BigNum) -> BigNum {
self.checked_div(oth).unwrap()
}
}

impl Rem<BigNum, BigNum> for BigNum {
fn rem(&self, oth: &BigNum) -> BigNum {
impl<'a> Rem<&'a BigNum, BigNum> for &'a BigNum {
fn rem(self, oth: &'a BigNum) -> BigNum {
self.checked_mod(oth).unwrap()
}
}

impl Shl<i32, BigNum> for BigNum {
fn shl(&self, n: &i32) -> BigNum {
self.checked_shl(n).unwrap()
impl<'a> Shl<i32, BigNum> for &'a BigNum {
fn shl(self, n: i32) -> BigNum {
self.checked_shl(&n).unwrap()
}
}

impl Shr<i32, BigNum> for BigNum {
fn shr(&self, n: &i32) -> BigNum {
self.checked_shr(n).unwrap()
impl<'a> Shr<i32, BigNum> for &'a BigNum {
fn shr(self, n: i32) -> BigNum {
self.checked_shr(&n).unwrap()
}
}

Expand Down

0 comments on commit 01a5d7c

Please sign in to comment.