-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis 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.9classDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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.
<script src='control.js'></script>ubuntu-latestCoverage ReportCreated: 2025-01-27 14:23Click here for information about interpreting this report.
Generated by llvm-cov -- llvm version 19.1.5-rust-1.84.0-stable |
This PR contains the following updates:
0.8
->0.9
Release Notes
rust-random/rand (rand)
v0.9.0
Compare Source
Security and unsafe
ReseedingRng
andThreadRng
. Instead, it is recommended to callThreadRng::reseed
on fork. (#1379)zerocopy
to replace someunsafe
code (#1349, #1393, #1446, #1502)Dependencies
--ignore-rust-version
rand_core
v0.9.0 (#1558)Features
std
feature withoutgetrandom
orrand_chacha
(#1354)small_rng
by default (#1455)rand_chacha
; usestd_rng
instead. (#1473)serde1
toserde
(#1477)getrandom
toos_rng
(#1537)thread_rng
(#1547)API changes: rand_core traits
RngCore::read_adapter
implementingstd::io::Read
(#1267)CryptoBlockRng: BlockRngCore
; maketrait CryptoRng: RngCore
(#1273)TryRngCore
,TryCryptoRng
(#1424, #1499)fn SeedableRng::from_rng
->try_from_rng
and add infallible variantfn from_rng
(#1424)fn SeedableRng::from_entropy
->from_os_rng
and add fallible variantfn try_from_os_rng
(#1424)Clone
andAsRef
to associated typeSeedableRng::Seed
(#1491)API changes: Rng trait and top-level fns
rand::thread_rng()
torand::rng()
and remove from the prelude (#1506)rand::random()
from the prelude (#1506)random_iter
,random_range
,random_bool
,random_ratio
,fill
(#1488)Rng::gen_iter
asrandom_iter
(#1305, #1500)Rng::gen
torandom
to avoid conflict with the newgen
keyword in Rust 2024 (#1438)Rng::gen_range
torandom_range
,gen_bool
torandom_bool
,gen_ratio
torandom_ratio
(#1505)#[track_caller]
(#1442, #1447)API changes: RNGs
<SmallRng as SeedableRng>::Seed
size to 256 bits (#1455)rng
) ofReseedingRng::new
(#1533)API changes: Sequences
SliceRandom
intoIndexedRandom
,IndexedMutRandom
,SliceRandom
(#1382)IndexedRandom::choose_multiple_array
,index::sample_array
(#1453, #1469)API changes: Distributions: renames
rand::distributions
torand::distr
(#1470)Standard
toStandardUniform
(#1526)distr::Slice
->distr::slice::Choose
,distr::EmptySlice
->distr::slice::Empty
(#1548)distr::DistString
->distr::SampleString
(#1548)distr::DistIter
->distr::Iter
,distr::DistMap
->distr::Map
(#1548)API changes: Distributions
Sized
bound onDistribution<T> for &D
(#1278)Distribution<Option<T>>
forStandardUniform
(#1526)StandardUniform
support allNonZero*
types (#1332){Uniform, UniformSampler}::{new, new_inclusive}
return aResult
(instead of potentially panicking) (#1229)Uniform
implementsTryFrom
instead ofFrom
for ranges (#1229)UniformUsize
(#1487)isize
andusize
values withStandardUniform
,Uniform
(except viaUniformUsize
) andFill
and usage as aWeightedAliasIndex
weight (#1487)DistString
for distributionsSlice<char>
andUniform<char>
(#1315)Slice::num_choices
(#1402)p()
for distributionBernoulli
to access probability (#1481)API changes: Weighted distributions
pub
modulerand::distr::weighted
, movingWeightedIndex
there (#1548)weighted::Weight
, allowingWeightedIndex
to trap overflow (#1353)weight, weights, total_weight
to distributionWeightedIndex
(#1420)WeightedError
toweighted::Error
, revising variants (#1382) and mark as#[non_exhaustive]
(#1480)API changes: SIMD
std::simd
, expand SIMD & docs (#1239)Reproducibility-breaking changes
ReseedingRng::reseed
discard remaining data from the last block generated (#1379)SmallRng::seed_from_u64
implementation (#1203)UniformFloat::new
samples andUniformFloat::sample_single
to yieldhigh
(#1462)Slice
(#1469)Uniform
forusize
portable viaUniformUsize
(#1487)IndexdRandom::choose_multiple_weighted
for very small seeds and optimize for large input length / low memory (#1530)Reproducibility-breaking optimisations
sample_floyd
, affecting output ofrand::seq::index::sample
andrand::seq::SliceRandom::choose_multiple
(#1277)IteratorRandom::choose
andchoose_stable
(#1268)SliceRandom::shuffle
andpartial_shuffle
(#1272)Uniform
: use Canon's method (single sampling) / Lemire's method (distribution sampling) for faster sampling (breaks value stability; #1287)sample_single_inclusive
for floats (+~20% perf) (#1289)Other optimisations
SmallRng
initialization performance (#1482)Other
Cargo.lock.msrv
file (#1275)rustfmt
and enforce (#1448)benches
crate (#1329, #1439) and migrate to Criterion (#1490)Documentation
ThreadRng
related docs (#1257)--generate-link-to-definition
feature (#1327)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.
This PR was generated by Mend Renovate. View the repository job log.