Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gen_range(a, b) -> gen_range(a..b) and gen_range(a..=b) #1003

Merged
merged 2 commits into from Aug 1, 2020

Commits on Aug 1, 2020

  1. Add UniformSampler::sample_single_inclusive

    This includes a specialized implementation for integers.
    Ralith authored and vks committed Aug 1, 2020
    Copy the full SHA
    2cdc6ca View commit details
    Browse the repository at this point in the history
  2. Change gen_range to accept Range types

    This adds support for `Rng::range(a..b)` and `Rng::range(a..=b)`,
    replacing `Rng::range(a, b)`. `a` and `b` must now implement
    `PartialEq`.
    
    This is a breaking change. In most cases, replacing
    `Rng::gen_range(a, b)` with `Rng::gen_range(a..b)` should be enough,
    however type annotations may be necessary, and `a` and `b` can no longer
    be references or SIMD types.
    
    SIMD types are still supported by `UniformSampler::sample_single`.
    
    Some clippy warnings were fixed as well.
    vks committed Aug 1, 2020
    Copy the full SHA
    870aea3 View commit details
    Browse the repository at this point in the history