Skip to content

Commit ef75e56

Browse files
authored
Fix Nightly Clippy lints (#1457)
1 parent 6a46506 commit ef75e56

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

rand_distr/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//!
3636
//! - The [`Distribution`] trait and [`DistIter`] helper type
3737
//! - The [`Standard`], [`Alphanumeric`], [`Uniform`], [`OpenClosed01`],
38-
//! [`Open01`], [`Bernoulli`], and [`WeightedIndex`] distributions
38+
//! [`Open01`], [`Bernoulli`], and [`WeightedIndex`] distributions
3939
//!
4040
//! ## Distributions
4141
//!

src/distributions/weighted_index.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ use serde::{Deserialize, Serialize};
3535
/// Time complexity of sampling from `WeightedIndex` is `O(log N)` where
3636
/// `N` is the number of weights. There are two alternative implementations with
3737
/// different runtimes characteristics:
38-
/// * [`rand_distr::weighted_alias`](https://docs.rs/rand_distr/*/rand_distr/weighted_alias/index.html)
39-
/// supports `O(1)` sampling, but with much higher initialisation cost.
40-
/// * [`rand_distr::weighted_tree`](https://docs.rs/rand_distr/*/rand_distr/weighted_tree/index.html)
41-
/// keeps the weights in a tree structure where sampling and updating is `O(log N)`.
38+
/// * [`rand_distr::weighted_alias`] supports `O(1)` sampling, but with much higher
39+
/// initialisation cost.
40+
/// * [`rand_distr::weighted_tree`] keeps the weights in a tree structure where sampling
41+
/// and updating is `O(log N)`.
4242
///
4343
/// A `WeightedIndex<X>` contains a `Vec<X>` and a [`Uniform<X>`] and so its
4444
/// size is the sum of the size of those objects, possibly plus some alignment.
@@ -80,6 +80,8 @@ use serde::{Deserialize, Serialize};
8080
///
8181
/// [`Uniform<X>`]: crate::distributions::Uniform
8282
/// [`RngCore`]: crate::RngCore
83+
/// [`rand_distr::weighted_alias`]: https://docs.rs/rand_distr/*/rand_distr/weighted_alias/index.html
84+
/// [`rand_distr::weighted_tree`]: https://docs.rs/rand_distr/*/rand_distr/weighted_tree/index.html
8385
#[derive(Debug, Clone, PartialEq)]
8486
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
8587
pub struct WeightedIndex<X: SampleUniform + PartialOrd> {

0 commit comments

Comments
 (0)