Skip to content

Commit

Permalink
Fix Nightly Clippy lints (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed May 25, 2024
1 parent 6a46506 commit ef75e56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rand_distr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
//!
//! - The [`Distribution`] trait and [`DistIter`] helper type
//! - The [`Standard`], [`Alphanumeric`], [`Uniform`], [`OpenClosed01`],
//! [`Open01`], [`Bernoulli`], and [`WeightedIndex`] distributions
//! [`Open01`], [`Bernoulli`], and [`WeightedIndex`] distributions
//!
//! ## Distributions
//!
Expand Down
10 changes: 6 additions & 4 deletions src/distributions/weighted_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ use serde::{Deserialize, Serialize};
/// Time complexity of sampling from `WeightedIndex` is `O(log N)` where
/// `N` is the number of weights. There are two alternative implementations with
/// different runtimes characteristics:
/// * [`rand_distr::weighted_alias`](https://docs.rs/rand_distr/*/rand_distr/weighted_alias/index.html)
/// supports `O(1)` sampling, but with much higher initialisation cost.
/// * [`rand_distr::weighted_tree`](https://docs.rs/rand_distr/*/rand_distr/weighted_tree/index.html)
/// keeps the weights in a tree structure where sampling and updating is `O(log N)`.
/// * [`rand_distr::weighted_alias`] supports `O(1)` sampling, but with much higher
/// initialisation cost.
/// * [`rand_distr::weighted_tree`] keeps the weights in a tree structure where sampling
/// and updating is `O(log N)`.
///
/// A `WeightedIndex<X>` contains a `Vec<X>` and a [`Uniform<X>`] and so its
/// size is the sum of the size of those objects, possibly plus some alignment.
Expand Down Expand Up @@ -80,6 +80,8 @@ use serde::{Deserialize, Serialize};
///
/// [`Uniform<X>`]: crate::distributions::Uniform
/// [`RngCore`]: crate::RngCore
/// [`rand_distr::weighted_alias`]: https://docs.rs/rand_distr/*/rand_distr/weighted_alias/index.html
/// [`rand_distr::weighted_tree`]: https://docs.rs/rand_distr/*/rand_distr/weighted_tree/index.html
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct WeightedIndex<X: SampleUniform + PartialOrd> {
Expand Down

0 comments on commit ef75e56

Please sign in to comment.