Fix Nightly Clippy lints (#1457)

This commit is contained in:
Artyom Pavlov 2024-05-25 17:17:43 +03:00 committed by GitHub
parent 6a4650691f
commit ef75e56cf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -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
//!

View File

@ -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.
@ -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> {