Merge pull request #31 from gifnksm/master

Fix for namespaced enums.
This commit is contained in:
Alex Crichton 2014-11-18 10:17:20 -06:00
commit d9fee8b585
2 changed files with 7 additions and 4 deletions

View File

@ -67,6 +67,7 @@ use std::str::{mod, FromStr};
use std::{i64, u64};
use {Num, Unsigned, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv, Signed, Zero, One};
use self::Sign::{Minus, NoSign, Plus};
/// A `BigDigit` is a `BigUint`'s composing element.
pub type BigDigit = u32;
@ -1471,7 +1472,8 @@ impl BigInt {
mod biguint_tests {
use Integer;
use super::{BigDigit, BigUint, ToBigUint, to_str_radix};
use super::{Plus, BigInt, RandBigInt, ToBigInt};
use super::{BigInt, RandBigInt, ToBigInt};
use super::Sign::Plus;
use std::cmp::{Less, Equal, Greater};
use std::str::FromStr;
@ -2335,7 +2337,8 @@ mod biguint_tests {
mod bigint_tests {
use Integer;
use super::{BigDigit, BigUint, ToBigUint};
use super::{Sign, Minus, NoSign, Plus, BigInt, RandBigInt, ToBigInt};
use super::{Sign, BigInt, RandBigInt, ToBigInt};
use super::Sign::{Minus, NoSign, Plus};
use std::cmp::{Less, Equal, Greater};
use std::i64;

View File

@ -18,7 +18,7 @@ use std::str::FromStr;
use std::num::{FromStrRadix, Float};
use std::iter::{AdditiveIterator, MultiplicativeIterator};
use bigint::{BigInt, BigUint, Sign, Plus, Minus};
use bigint::{BigInt, BigUint, Sign};
use {Num, Signed, Zero, One};
/// Represents the ratio between 2 numbers.
@ -186,7 +186,7 @@ impl Ratio<BigInt> {
return None;
}
let (mantissa, exponent, sign) = f.integer_decode();
let bigint_sign: Sign = if sign == 1 { Plus } else { Minus };
let bigint_sign = if sign == 1 { Sign::Plus } else { Sign::Minus };
if exponent < 0 {
let one: BigInt = One::one();
let denom: BigInt = one << ((-exponent) as uint);