Skip to content

rand_pcg has zero usage examples #1347

@kornelski

Description

@kornelski

The crate page for rand_pcg has no code examples. It links to documentation, but it's a documentation of implementation details of the algorithm, rather than how to actually use any of this crate's functionality. As far as I can tell, there is not a single piece of code demonstrating generating a random number anywhere in the crate's docs.

Everything about this crate assumes the user is already familiar with the rand crate. However, from rand's docs it's not obvious how to use the other algorithms with it either. The Additional generators section just lists them, but has no code examples, and it just links back to code-less docs of rand_pcg and others, which feels like a catch 22.

The key to this puzzle is very hard to spot. Everything user needs to know is folded hidden, and sandwiched between implementations of irrelevant traits, camouflaged to look like boilerplate lists:

Screenshot 2023-10-25 at 02 52 52

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