@@ -88,7 +88,7 @@ pub trait SampleRange {
88
88
}
89
89
90
90
macro_rules! integer_impl {
91
- ( $ty: ty, $unsigned: ty ) => {
91
+ ( $ty: ty, $unsigned: ident ) => {
92
92
impl SampleRange for $ty {
93
93
// we play free and fast with unsigned vs signed here
94
94
// (when $ty is signed), but that's fine, since the
@@ -98,7 +98,7 @@ macro_rules! integer_impl {
98
98
99
99
fn construct_range( low: $ty, high: $ty) -> Range <$ty> {
100
100
let range = ( w( high as $unsigned) - w( low as $unsigned) ) . 0 ;
101
- let unsigned_max: $unsigned = - 1 as $unsigned;
101
+ let unsigned_max: $unsigned = :: std :: $unsigned:: MAX ;
102
102
103
103
// this is the largest number that fits into $unsigned
104
104
// that `range` divides evenly, so, if we've sampled
@@ -163,7 +163,6 @@ float_impl! { f64 }
163
163
164
164
#[ cfg( test) ]
165
165
mod tests {
166
- use std:: num:: Int ;
167
166
use distributions:: { Sample , IndependentSample } ;
168
167
use super :: Range as Range ;
169
168
@@ -182,11 +181,11 @@ mod tests {
182
181
fn test_integers ( ) {
183
182
let mut rng = :: test:: rng ( ) ;
184
183
macro_rules! t {
185
- ( $( $ty: ty ) ,* ) => { {
184
+ ( $( $ty: ident ) ,* ) => { {
186
185
$(
187
186
let v: & [ ( $ty, $ty) ] = & [ ( 0 , 10 ) ,
188
187
( 10 , 127 ) ,
189
- ( Int :: min_value ( ) , Int :: max_value ( ) ) ] ;
188
+ ( :: std :: $ty :: MIN , :: std :: $ty :: MAX ) ] ;
190
189
for & ( low, high) in v. iter( ) {
191
190
let mut sampler: Range <$ty> = Range :: new( low, high) ;
192
191
for _ in 0 ..1000 {
0 commit comments