Skip to content

Commit

Permalink
remove unneccessary admonition from choose docs
Browse files Browse the repository at this point in the history
IteratorRandom::choose also guarantees O(1) performance for slices, so
there is no need to recommend an alternative
  • Loading branch information
kazcw committed Oct 11, 2020
1 parent 77c4732 commit 7f6eca4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/seq/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@ pub trait IteratorRandom: Iterator + Sized {
/// depends on size hints. In particular, `Iterator` combinators that don't
/// change the values yielded but change the size hints may result in
/// `choose` returning different elements.
///
/// For slices, prefer [`SliceRandom::choose`] which guarantees `O(1)`
/// performance.
fn choose<R>(mut self, rng: &mut R) -> Option<Self::Item>
where R: Rng + ?Sized {
let (mut lower, mut upper) = self.size_hint();
Expand Down

0 comments on commit 7f6eca4

Please sign in to comment.