@@ -22,7 +22,7 @@ use core::prelude::*;
22
22
use core:: iterator:: IteratorUtil ;
23
23
use core:: cmp:: { Eq , Ord , TotalEq , TotalOrd , Ordering , Less , Equal , Greater } ;
24
24
use core:: int;
25
- use core:: num:: { IntConvertible , Zero , One , ToStrRadix , FromStrRadix , Orderable } ;
25
+ use core:: num:: { IntConvertible , Zero , One , ToStrRadix , FromStrRadix , Orderable , min , max } ;
26
26
use core:: str;
27
27
use core:: uint;
28
28
use core:: vec;
@@ -205,7 +205,7 @@ impl Unsigned for BigUint {}
205
205
impl Add < BigUint , BigUint > for BigUint {
206
206
207
207
fn add ( & self , other : & BigUint ) -> BigUint {
208
- let new_len = uint :: max ( self . data . len ( ) , other. data . len ( ) ) ;
208
+ let new_len = max ( self . data . len ( ) , other. data . len ( ) ) ;
209
209
210
210
let mut carry = 0 ;
211
211
let sum = do vec:: from_fn ( new_len) |i| {
@@ -225,7 +225,7 @@ impl Add<BigUint, BigUint> for BigUint {
225
225
impl Sub < BigUint , BigUint > for BigUint {
226
226
227
227
fn sub ( & self , other : & BigUint ) -> BigUint {
228
- let new_len = uint :: max ( self . data . len ( ) , other. data . len ( ) ) ;
228
+ let new_len = max ( self . data . len ( ) , other. data . len ( ) ) ;
229
229
230
230
let mut borrow = 0 ;
231
231
let diff = do vec:: from_fn ( new_len) |i| {
@@ -261,7 +261,7 @@ impl Mul<BigUint, BigUint> for BigUint {
261
261
// = a1*b1 * base^2 +
262
262
// (a1*b1 + a0*b0 - (a1-b0)*(b1-a0)) * base +
263
263
// a0*b0
264
- let half_len = uint :: max ( s_len, o_len) / 2 ;
264
+ let half_len = max ( s_len, o_len) / 2 ;
265
265
let ( sHi, sLo) = cut_at ( self , half_len) ;
266
266
let ( oHi, oLo) = cut_at ( other, half_len) ;
267
267
@@ -298,7 +298,7 @@ impl Mul<BigUint, BigUint> for BigUint {
298
298
299
299
300
300
fn cut_at ( a : & BigUint , n : uint ) -> ( BigUint , BigUint ) {
301
- let mid = uint :: min ( a. data . len ( ) , n) ;
301
+ let mid = min ( a. data . len ( ) , n) ;
302
302
return ( BigUint :: from_slice ( vec:: slice ( a. data , mid,
303
303
a. data . len ( ) ) ) ,
304
304
BigUint :: from_slice ( vec:: slice ( a. data , 0 , mid) ) ) ;
@@ -482,7 +482,7 @@ impl Integer for BigUint {
482
482
impl IntConvertible for BigUint {
483
483
484
484
fn to_int( & self ) -> int {
485
- uint : : min( self . to_uint( ) , int:: max_value as uint) as int
485
+ min( self . to_uint( ) , int:: max_value as uint) as int
486
486
}
487
487
488
488
@@ -578,7 +578,7 @@ impl BigUint {
578
578
let mut n: BigUint = Zero :: zero ( ) ;
579
579
let mut power: BigUint = One :: one ( ) ;
580
580
loop {
581
- let start = uint :: max ( end, unit_len) - unit_len;
581
+ let start = max ( end, unit_len) - unit_len;
582
582
match uint:: parse_bytes ( vec:: slice ( buf, start, end) , radix) {
583
583
// FIXME(#6102): Assignment operator for BigInt causes ICE
584
584
// Some(d) => n += BigUint::from_uint(d) * power,
@@ -1053,9 +1053,9 @@ impl IntConvertible for BigInt {
1053
1053
1054
1054
fn to_int ( & self ) -> int {
1055
1055
match self . sign {
1056
- Plus => uint :: min ( self . to_uint ( ) , int:: max_value as uint ) as int ,
1056
+ Plus => min ( self . to_uint ( ) , int:: max_value as uint ) as int ,
1057
1057
Zero => 0 ,
1058
- Minus => uint :: min ( ( -self ) . to_uint ( ) ,
1058
+ Minus => min ( ( -self ) . to_uint ( ) ,
1059
1059
( int:: max_value as uint ) + 1 ) as int
1060
1060
}
1061
1061
}
0 commit comments