Skip to content

Commit 2dfbf14

Browse files
authored
Merge pull request #1 from dhardy/uniform-result
Small fixes
2 parents b1080b0 + 6695abe commit 2dfbf14

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

examples/rayon-monte-carlo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static BATCH_SIZE: u64 = 10_000;
4949
static BATCHES: u64 = 1000;
5050

5151
fn main() {
52-
let range = Uniform::new(-1.0f64, 1.0);
52+
let range = Uniform::new(-1.0f64, 1.0).unwrap();
5353

5454
let in_circle = (0..BATCHES)
5555
.into_par_iter()

src/distributions/uniform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
use core::fmt;
107107
use core::time::Duration;
108108
use core::ops::{Range, RangeInclusive};
109-
use std::convert::TryFrom;
109+
use core::convert::TryFrom;
110110

111111
use crate::distributions::float::IntoFloat;
112112
use crate::distributions::utils::{BoolAsSIMD, FloatAsSIMD, FloatSIMDUtils, IntAsSIMD, WideningMultiply};

src/distributions/weighted_index.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ impl<X> Distribution<usize> for WeightedIndex<X>
230230
where X: SampleUniform + PartialOrd
231231
{
232232
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize {
233-
use ::core::cmp::Ordering;
234233
let chosen_weight = self.weight_distribution.sample(rng);
235234
// Find the first item which has a weight *higher* than the chosen weight.
236235
self.cumulative_weights.partition_point(|w| w <= &chosen_weight)

0 commit comments

Comments
 (0)