Use rand::random() or rand::Rng::fill() in place of the now-removed OsRng.fill_bytes(), note that the generic function now supports arrays of any length. Replace the deprecated rand::thread_rng() with its new name rand::rng() or with new alternatives such as rand::random_range() where appropriate. In fuzz/, update the impl of rand_core::RndCore which now does not require implementing try_fill_bytes() (moved to TryRndCore) so remove it as the function was only used by unit tests (which can also be removed). As a result, CrosVM now follow the clean split of all client code only depending on rand::Rnd (no imports of RndCore left) and the one provided (FuzzRng) uses the rand_core crate, as recommended by the crate docs. BUG=b:460349550 TEST=tools/presubmit Change-Id: Icf0121297efcb0388e8aab17394c21457edbb119 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/7253053 Auto-Submit: Pierre-Clément Tosi <ptosi@google.com> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: Pierre-Clément Tosi <ptosi@google.com> |
||
|---|---|---|
| .. | ||
| fuzz_targets | ||
| src | ||
| .gitignore | ||
| Cargo.toml | ||