Fix for namespaced enums.

This commit is contained in:
gifnksm 2014-11-18 21:09:53 +09:00
parent c0df55e470
commit 233c02030d
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);