thread_rng() → rand::rng()#1506
Merged
dhardy merged 6 commits intorust-random:masterfrom Oct 11, 2024
Merged
Conversation
newpavlov
approved these changes
Oct 9, 2024
primeos-work
added a commit
to science-computing/butido
that referenced
this pull request
Feb 3, 2025
Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.9.0. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](rust-random/rand@0.8.5...0.9.0) --- updated-dependencies: - dependency-name: rand dependency-type: direct:production update-type: version-update:semver-minor ... The function `rand::thread_rng()` got renamed to `rand::rng()`: rust-random/rand#1506 Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Michael Weiss <michael.weiss@eviden.com>
benjamin-lieser
pushed a commit
to benjamin-lieser/rand
that referenced
this pull request
Feb 5, 2025
- Rename `rand::thread_rng()` → `rand::rng()` - Remove `thread_rng()` and `random()` from the prelude
benjamin-lieser
pushed a commit
to benjamin-lieser/rand
that referenced
this pull request
Feb 5, 2025
- Rename `rand::thread_rng()` → `rand::rng()` - Remove `thread_rng()` and `random()` from the prelude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG.mdentrySummary
rand::thread_rng()→rand::rng()thread_rng()andrandom()from the preludeMotivation
Make this frequently used function easier to type. The "thread-local" part is a design decision which does not (usually) need to be considered during usage, and thus should not be part of the name. See #989.
Details
ThreadRngis not renamed since thread-locality is a key part of its identity, and it is less commonly used directly. Also, the namerand::Rngis already taken.