@@ -38,7 +38,7 @@ use distributions::{Distribution, Uniform01, Rand};
38
38
/// let m: f64 = range(-40.0f64, 1.3e5f64, &mut rng);
39
39
/// println!("{}", m);
40
40
/// ```
41
- pub fn range < T : PartialOrd + SampleRange , R : Rng +?Sized > ( low : T , high : T , rng : & mut R ) -> T {
41
+ pub fn range < T : SampleRange , R : Rng +?Sized > ( low : T , high : T , rng : & mut R ) -> T {
42
42
assert ! ( low < high, "distributions::range called with low >= high" ) ;
43
43
SampleRange :: construct_range ( low, high) . sample ( rng)
44
44
}
@@ -90,7 +90,7 @@ pub struct Range<X> {
90
90
pub zone : X
91
91
}
92
92
93
- impl < X : SampleRange + PartialOrd > Range < X > {
93
+ impl < X : SampleRange > Range < X > {
94
94
/// Create a new `Range` instance that samples uniformly from
95
95
/// `[low, high)`. Panics if `low >= high`.
96
96
pub fn new ( low : X , high : X ) -> Range < X > {
@@ -108,7 +108,7 @@ impl<T: SampleRange> Distribution<T> for Range<T> {
108
108
/// The helper trait for types that have a sensible way to sample
109
109
/// uniformly between two values. This should not be used directly,
110
110
/// and is only to facilitate `Range`.
111
- pub trait SampleRange : Sized {
111
+ pub trait SampleRange : PartialOrd + Sized {
112
112
/// Construct the `Range` object that `sample_range`
113
113
/// requires. This should not ever be called directly, only via
114
114
/// `Range::new`, which will check that `low < high`, so this
0 commit comments