Skip to content

Commit

Permalink
Clippy: adjust doc first paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Sep 13, 2024
1 parent e4c2daf commit 2a5de77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions rand_distr/src/weighted_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,10 @@ where
}
}

/// Trait that must be implemented for weights, that are used with
/// [`WeightedAliasIndex`]. Currently no guarantees on the correctness of
/// [`WeightedAliasIndex`] are given for custom implementations of this trait.
/// Weight bound for [`WeightedAliasIndex`]
///
/// Currently no guarantees on the correctness of [`WeightedAliasIndex`] are
/// given for custom implementations of this trait.
pub trait AliasableWeight:
Sized
+ Copy
Expand Down
10 changes: 6 additions & 4 deletions src/seq/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,12 @@ where
}
}

/// Randomly sample exactly `amount` distinct indices from `0..length`, and
/// return them in an arbitrary order (there is no guarantee of shuffling or
/// ordering). The weights are to be provided by the input function `weights`,
/// which will be called once for each index.
/// Randomly sample exactly `amount` distinct indices from `0..length`
///
/// Results are in arbitrary order (there is no guarantee of shuffling or
/// ordering).
///
/// Function `weight` is called once for each index to provide weights.
///
/// This method is used internally by the slice sampling methods, but it can
/// sometimes be useful to have the indices themselves so this is provided as
Expand Down

0 comments on commit 2a5de77

Please sign in to comment.