From b43c1ab258520c0b731d8cf8ca1aa80f161c978b Mon Sep 17 00:00:00 2001 From: Nicolas Kirchner Date: Tue, 15 Aug 2017 01:39:43 +0200 Subject: [PATCH] Replace the use of a feature not yet implemented in rust 1.8 --- bigint/src/algorithms.rs | 4 ++-- bigint/src/bigint.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bigint/src/algorithms.rs b/bigint/src/algorithms.rs index 2082d04..2c28113 100644 --- a/bigint/src/algorithms.rs +++ b/bigint/src/algorithms.rs @@ -408,8 +408,8 @@ fn mac3(acc: &mut [BigDigit], b: &[BigDigit], c: &[BigDigit]) { comp1 = comp1 - &comp3; let result = r0 + (comp1 << 32*i) + (comp2 << 2*32*i) + (comp3 << 3*32*i) + (r4 << 4*32*i); - assert!(result.sign != Minus); - add2(&mut acc[..], &result.data.data); + let result_pos = result.to_biguint().unwrap(); + add2(&mut acc[..], &result_pos.data); } } diff --git a/bigint/src/bigint.rs b/bigint/src/bigint.rs index f3cd4ec..bae78d7 100644 --- a/bigint/src/bigint.rs +++ b/bigint/src/bigint.rs @@ -105,8 +105,8 @@ impl serde::Deserialize for Sign { #[derive(Clone, Debug, Hash)] #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] pub struct BigInt { - pub(super) sign: Sign, - pub(super) data: BigUint, + sign: Sign, + data: BigUint, } impl PartialEq for BigInt {