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

fix(deps): update rust crate rand to 0.9 #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 27, 2025

This PR contains the following updates:

Package Type Update Change
rand (source) dependencies minor 0.8 -> 0.9

Release Notes

rust-random/rand (rand)

v0.9.0

Compare Source

Security and unsafe
  • Policy: "rand is not a crypto library" (#​1514)
  • Remove fork-protection from ReseedingRng and ThreadRng. Instead, it is recommended to call ThreadRng::reseed on fork. (#​1379)
  • Use zerocopy to replace some unsafe code (#​1349, #​1393, #​1446, #​1502)
Dependencies
Features
  • Support std feature without getrandom or rand_chacha (#​1354)
  • Enable feature small_rng by default (#​1455)
  • Remove implicit feature rand_chacha; use std_rng instead. (#​1473)
  • Rename feature serde1 to serde (#​1477)
  • Rename feature getrandom to os_rng (#​1537)
  • Add feature thread_rng (#​1547)
API changes: rand_core traits
  • Add fn RngCore::read_adapter implementing std::io::Read (#​1267)
  • Add trait CryptoBlockRng: BlockRngCore; make trait CryptoRng: RngCore (#​1273)
  • Add traits TryRngCore, TryCryptoRng (#​1424, #​1499)
  • Rename fn SeedableRng::from_rng -> try_from_rng and add infallible variant fn from_rng (#​1424)
  • Rename fn SeedableRng::from_entropy -> from_os_rng and add fallible variant fn try_from_os_rng (#​1424)
  • Add bounds Clone and AsRef to associated type SeedableRng::Seed (#​1491)
API changes: Rng trait and top-level fns
  • Rename fn rand::thread_rng() to rand::rng() and remove from the prelude (#​1506)
  • Remove fn rand::random() from the prelude (#​1506)
  • Add top-level fns random_iter, random_range, random_bool, random_ratio, fill (#​1488)
  • Re-introduce fn Rng::gen_iter as random_iter (#​1305, #​1500)
  • Rename fn Rng::gen to random to avoid conflict with the new gen keyword in Rust 2024 (#​1438)
  • Rename fns Rng::gen_range to random_range, gen_bool to random_bool, gen_ratio to random_ratio (#​1505)
  • Annotate panicking methods with #[track_caller] (#​1442, #​1447)
API changes: RNGs
  • Fix <SmallRng as SeedableRng>::Seed size to 256 bits (#​1455)
  • Remove first parameter (rng) of ReseedingRng::new (#​1533)
API changes: Sequences
  • Split trait SliceRandom into IndexedRandom, IndexedMutRandom, SliceRandom (#​1382)
  • Add IndexedRandom::choose_multiple_array, index::sample_array (#​1453, #​1469)
API changes: Distributions: renames
  • Rename module rand::distributions to rand::distr (#​1470)
  • Rename distribution Standard to StandardUniform (#​1526)
  • Move distr::Slice -> distr::slice::Choose, distr::EmptySlice -> distr::slice::Empty (#​1548)
  • Rename trait distr::DistString -> distr::SampleString (#​1548)
  • Rename distr::DistIter -> distr::Iter, distr::DistMap -> distr::Map (#​1548)
API changes: Distributions
  • Relax Sized bound on Distribution<T> for &D (#​1278)
  • Remove impl of Distribution<Option<T>> for StandardUniform (#​1526)
  • Let distribution StandardUniform support all NonZero* types (#​1332)
  • Fns {Uniform, UniformSampler}::{new, new_inclusive} return a Result (instead of potentially panicking) (#​1229)
  • Distribution Uniform implements TryFrom instead of From for ranges (#​1229)
  • Add UniformUsize (#​1487)
  • Remove support for generating isize and usize values with StandardUniform, Uniform (except via UniformUsize) and Fill and usage as a WeightedAliasIndex weight (#​1487)
  • Add impl DistString for distributions Slice<char> and Uniform<char> (#​1315)
  • Add fn Slice::num_choices (#​1402)
  • Add fn p() for distribution Bernoulli to access probability (#​1481)
API changes: Weighted distributions
  • Add pub module rand::distr::weighted, moving WeightedIndex there (#​1548)
  • Add trait weighted::Weight, allowing WeightedIndex to trap overflow (#​1353)
  • Add fns weight, weights, total_weight to distribution WeightedIndex (#​1420)
  • Rename enum WeightedError to weighted::Error, revising variants (#​1382) and mark as #[non_exhaustive] (#​1480)
API changes: SIMD
  • Switch to std::simd, expand SIMD & docs (#​1239)
Reproducibility-breaking changes
  • Make ReseedingRng::reseed discard remaining data from the last block generated (#​1379)
  • Change fn SmallRng::seed_from_u64 implementation (#​1203)
  • Allow UniformFloat::new samples and UniformFloat::sample_single to yield high (#​1462)
  • Fix portability of distribution Slice (#​1469)
  • Make Uniform for usize portable via UniformUsize (#​1487)
  • Fix IndexdRandom::choose_multiple_weighted for very small seeds and optimize for large input length / low memory (#​1530)
Reproducibility-breaking optimisations
  • Optimize fn sample_floyd, affecting output of rand::seq::index::sample and rand::seq::SliceRandom::choose_multiple (#​1277)
  • New, faster algorithms for IteratorRandom::choose and choose_stable (#​1268)
  • New, faster algorithms for SliceRandom::shuffle and partial_shuffle (#​1272)
  • Optimize distribution Uniform: use Canon's method (single sampling) / Lemire's method (distribution sampling) for faster sampling (breaks value stability; #​1287)
  • Optimize fn sample_single_inclusive for floats (+~20% perf) (#​1289)
Other optimisations
  • Improve SmallRng initialization performance (#​1482)
  • Optimise SIMD widening multiply (#​1247)
Other
Documentation
  • Improve ThreadRng related docs (#​1257)
  • Docs: enable experimental --generate-link-to-definition feature (#​1327)
  • Better doc of crate features, use doc_auto_cfg (#​1411, #​1450)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

sourcery-ai bot commented Jan 27, 2025

Reviewer's Guide by Sourcery

This pull request updates the rand crate from version 0.8 to 0.9. This is a minor version update that includes several API changes, performance improvements, and bug fixes.

Class diagram showing key API changes in rand 0.9

classDiagram
    class Rng {
      -gen() renamed to random()
      -gen_range() renamed to random_range()
      -gen_bool() renamed to random_bool()
      -gen_ratio() renamed to random_ratio()
    }

    class SeedableRng {
      -from_rng() renamed to try_from_rng()
      -from_entropy() renamed to from_os_rng()
      +try_from_os_rng()* new
    }

    class Distribution {
      <<interface>>
    }

    class StandardUniform {
      note for StandardUniform "Renamed from Standard"
    }

    class WeightedIndex {
      +weight()* new
      +weights()* new
      +total_weight()* new
    }

    Distribution <|-- StandardUniform
    Distribution <|-- WeightedIndex
Loading

File-Level Changes

Change Details Files
Update rand crate dependency
  • Updated the rand crate version from 0.8 to 0.9 in the Cargo.toml file
Cargo.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. Here's why:

  • It seems to have been created by a bot (hey, renovate[bot]!). We assume it knows what it's doing!
  • We don't review packaging changes - Let us know if you'd like us to change this.

Copy link

<script src='control.js'></script>

ubuntu-latest

Coverage Report

Created: 2025-01-27 14:23

Click here for information about interpreting this report.

FilenameFunction CoverageLine CoverageRegion CoverageBranch Coverage
src/apply.rs
   0.00% (0/9)
   0.00% (0/162)
   0.00% (0/109)
- (0/0)
src/cli.rs
   0.00% (0/6)
   0.00% (0/14)
   0.00% (0/6)
- (0/0)
src/config/config_base.rs
  96.15% (25/26)
  99.30% (714/719)
  94.41% (169/179)
- (0/0)
src/config/connection.rs
  80.00% (4/5)
  86.54% (45/52)
  81.82% (9/11)
- (0/0)
src/config/role.rs
  90.00% (9/10)
  79.37% (50/63)
  76.00% (38/50)
- (0/0)
src/config/role_database.rs
 100.00% (3/3)
  94.34% (50/53)
  87.50% (21/24)
- (0/0)
src/config/role_schema.rs
 100.00% (3/3)
  94.55% (52/55)
  86.96% (20/23)
- (0/0)
src/config/role_table.rs
 100.00% (14/14)
  97.17% (240/247)
  92.71% (89/96)
- (0/0)
src/config/user.rs
 100.00% (17/17)
  98.53% (134/136)
  95.35% (41/43)
- (0/0)
src/connection.rs
  82.35% (28/34)
  76.34% (384/503)
  53.23% (99/186)
- (0/0)
src/gen.rs
  62.50% (5/8)
  74.42% (64/86)
  61.76% (21/34)
- (0/0)
src/inspect.rs
   0.00% (0/16)
   0.00% (0/127)
   0.00% (0/51)
- (0/0)
src/main.rs
   0.00% (0/1)
   0.00% (0/30)
   0.00% (0/25)
- (0/0)
src/validate.rs
   0.00% (0/5)
   0.00% (0/53)
   0.00% (0/35)
- (0/0)
tests/cli-apply.rs
 100.00% (5/5)
 100.00% (74/74)
 100.00% (9/9)
- (0/0)
tests/cli-gen.rs
 100.00% (6/6)
 100.00% (57/57)
 100.00% (6/6)
- (0/0)
tests/cli-inspect.rs
 100.00% (1/1)
 100.00% (23/23)
 100.00% (1/1)
- (0/0)
tests/cli-validate.rs
 100.00% (10/10)
 100.00% (312/312)
 100.00% (10/10)
- (0/0)
Totals
  72.63% (130/179)
  79.50% (2199/2766)
  59.35% (533/898)
- (0/0)
Generated by llvm-cov -- llvm version 19.1.5-rust-1.84.0-stable

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.

0 participants