Skip to content

Commit

Permalink
Remove FromRandom bound on Random::choose
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkleiny committed Aug 10, 2024
1 parent a2b7b48 commit 15eccef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/common/src/maths/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Random {
}

/// Chooses a random value from the given iterator.
pub fn choose<'a, T: FromRandom>(&mut self, values: impl IntoIterator<Item = &'a T>) -> Option<&'a T> {
pub fn choose<T>(&mut self, values: impl IntoIterator<Item = T>) -> Option<T> {
let mut iter = values.into_iter();

// if we can get the upper bound, we can choose a random index directly
Expand Down

0 comments on commit 15eccef

Please sign in to comment.