Skip to content

Bump rand 0.8 → 0.10 and update all API usages#1109

Merged
svarlamov merged 1 commit intomainfrom
devin/1776199794-bump-rand-0.10
Apr 15, 2026
Merged

Bump rand 0.8 → 0.10 and update all API usages#1109
svarlamov merged 1 commit intomainfrom
devin/1776199794-bump-rand-0.10

Conversation

@svarlamov
Copy link
Copy Markdown
Member

@svarlamov svarlamov commented Apr 14, 2026

Summary

Upgrades the rand dev-dependency from 0.8 to 0.10 and migrates all test code to the new API surface. No production code changes — rand is only used in integration tests for generating random temp directory names and selecting random file subsets.

API migrations applied

rand 0.8 rand 0.10
rand::thread_rng() rand::rng()
rand::Rng trait rand::RngExt trait
.gen_range(range) .random_range(range)
rand::distributions::Alphanumeric rand::distr::Alphanumeric
rand::seq::SliceRandom rand::seq::IndexedRandom
.choose_multiple(&mut rng, n) .sample(&mut rng, n)

Files changed

  • Cargo.toml / Cargo.lock: Version bump + dependency tree update (rand_chacha/ppv-lite86 replaced by chacha20)
  • tests/integration/repos/test_repo.rs: 8 call sites updated (random temp dir names)
  • tests/integration/performance.rs: Imports + 4 call sites (random file selection)
  • tests/integration/checkpoint_size.rs: Import + 1 call site (random string generation)
  • tests/integration/worktrees.rs: Import + 1 call site (unique worktree path)

Review & Testing Checklist for Human

  • Verify .sample() (rand 0.10 IndexedRandom) is semantically equivalent to .choose_multiple() (rand 0.8 SliceRandom) — both should return n random elements without replacement
  • Confirm CI passes on all three platforms (Ubuntu, macOS, Windows) since rand's RNG backend changed from ppv-lite86 to chacha20
  • Spot-check that no test relies on deterministic RNG output (all usages appear to be for unique temp dir names / random subset selection, so this should be fine)

Notes

Link to Devin session: https://app.devin.ai/sessions/75f76db47e0247a08f64c032f757b9e6
Requested by: @svarlamov


Open with Devin

- Cargo.toml: rand "0.8" -> "0.10"
- rand::thread_rng() -> rand::rng()
- rand::Rng -> rand::RngExt (gen_range/sample moved to RngExt)
- .gen_range() -> .random_range()
- rand::distributions::Alphanumeric -> rand::distr::Alphanumeric
- rand::seq::SliceRandom -> rand::seq::IndexedRandom
- .choose_multiple() -> .sample()

Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@svarlamov svarlamov merged commit ec1e53d into main Apr 15, 2026
24 of 26 checks passed
@svarlamov svarlamov deleted the devin/1776199794-bump-rand-0.10 branch April 15, 2026 03:22
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