Skip to content

rng: fix 2 deprecated methods#172

Merged
rajgandhi1 merged 2 commits into
rajgandhi1:mainfrom
martinfrances107:deprecated_rng
Jun 15, 2026
Merged

rng: fix 2 deprecated methods#172
rajgandhi1 merged 2 commits into
rajgandhi1:mainfrom
martinfrances107:deprecated_rng

Conversation

@martinfrances107

Copy link
Copy Markdown
Contributor

What does this PR do?

There are two deprecated function call the need fixing

A)

  • let mut rng = thread_rng();
  • let mut rng = rng();

B)

  • let x = -5.0 + rng.gen_range(-0.1..0.1);
  • let x = -5.0 + rng.random_range(-0.1..0.1);

@rajgandhi1

rajgandhi1 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

@martinfrances107 can you rebase with the current main and resolve merge conflicts? The fix looks correct.

A)
- let mut rng = thread_rng();
+ let mut rng = rng();

B)
- let x = -5.0 + rng.gen_range(-0.1..0.1);
+ let x = -5.0 + rng.random_range(-0.1..0.1);
@martinfrances107

Copy link
Copy Markdown
Contributor Author

No problem, I have rebased - and visually inspected the changes.

@rajgandhi1 rajgandhi1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rajgandhi1 rajgandhi1 merged commit d726d19 into rajgandhi1:main Jun 15, 2026
5 checks passed
@martinfrances107 martinfrances107 deleted the deprecated_rng branch June 15, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants