Modern Apps git

← Modern-Apps.git

all: fix rand_ext RngExt and geodb missing docs

Commit
aaa626dc2dc30bd974b6b2ac454790ca34aa64c0
Author
vayun-mathur <[email protected]>
When
2026-10-14 23:44 UTC (1 month ago)
Parents
381246a

Diff

scripts/networklocation/geodb_build/src/extract_extra.rs
diff --git a/scripts/networklocation/geodb_build/src/extract_extra.rs b/scripts/networklocation/geodb_build/src/extract_extra.rsindex e704c22ce4..03cd939c7e 100644--- a/scripts/networklocation/geodb_build/src/extract_extra.rs+++ b/scripts/networklocation/geodb_build/src/extract_extra.rs@@ -1,2 +1,6 @@+//! Supplemental street-geometry extractors for the geocoder build.+//!+//! Minimum spacing and sampling helpers shared by the street extract passes.+ /// Minimum spacing between samples along a street, in e7 latitude units (~100 m). pub const STREET_SAMPLE_E7: i64 = 10_000;
third_party/betocore/rand_ext/src/lib.rs
diff --git a/third_party/betocore/rand_ext/src/lib.rs b/third_party/betocore/rand_ext/src/lib.rsindex 5f42f2bfdc..4bd7c7d6cd 100644--- a/third_party/betocore/rand_ext/src/lib.rs+++ b/third_party/betocore/rand_ext/src/lib.rs@@ -20,7 +20,7 @@ extern crate alloc; use alloc::vec::Vec; use crypto_provider::{CryptoProvider, CryptoRng}; use log::info;-use rand::{Rng as _, SeedableRng};+use rand::{Rng, RngExt, SeedableRng}; pub use {rand, rand_pcg};  /// Returns a random Vec with the provided length.@@ -40,21 +40,21 @@ pub fn random_bytes<const B: usize, C: CryptoProvider>(rng: &mut C::CryptoRng) - /// Uses a RustCrypto Rng to return a random Vec with the provided length pub fn random_vec_rc<R: rand::Rng>(rng: &mut R, len: usize) -> Vec<u8> {     let mut bytes = Vec::<u8>::new();-    bytes.extend((0..len).map(|_| rng.gen::<u8>()));+    bytes.extend((0..len).map(|_| rng.random::<u8>()));     bytes }  /// Uses a RustCrypto Rng to return random bytes with the provided length pub fn random_bytes_rc<const B: usize, R: rand::Rng>(rng: &mut R) -> [u8; B] {     let mut bytes = [0; B];-    rng.fill(bytes.as_mut_slice());+    rng.fill_bytes(bytes.as_mut_slice());     bytes }  /// Returns a fast rng seeded with the thread rng (which is itself seeded from the OS). pub fn seeded_rng() -> rand_pcg::Pcg64 {     let mut seed: <rand_pcg::Pcg64 as rand::SeedableRng>::Seed = Default::default();-    rand::thread_rng().fill(&mut seed);+    rand::rng().fill_bytes(&mut seed);     // print it out so if a test fails, the seed will be visible for further investigation     info!("seed: {seed:?}");     rand_pcg::Pcg64::from_seed(seed)