Skip to content

Documentation for IteratorRandom is confusing about what "sized iterators" means #1022

@ChaiTRex

Description

@ChaiTRex

From the top of the docs page for rand::seq::IteratorRandom, it says:

This trait is implemented on all sized iterators, providing methods for choosing one or more elements.

Sized can have two meanings: Sized and ExactSizeIterator (one might naively assume it needs to know the number of elements in the iterator to know how to not go past the end of it).

Since it appears from the source code that it refers to Sized, can the documentation please be updated to:

This trait is implemented on all Sized iterators, providing methods for choosing one or more elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions