.cargo/config.toml
.cargo/config.toml
This file has not been changed.
.gitignore
.gitignore
This file has not been changed.
.tangled/workflows/miri.yml
.tangled/workflows/miri.yml
This file has not been changed.
.tangled/workflows/test.yml
.tangled/workflows/test.yml
This file has not been changed.
+32
-16
Cargo.lock
+32
-16
Cargo.lock
···
847
847
"nailkov",
848
848
"nailrng",
849
849
"pin-project-lite",
850
-
"rand",
850
+
"rand 0.10.0",
851
851
"tokio",
852
852
"tracing",
853
853
"winnow",
···
882
882
"itertools",
883
883
"nailrng",
884
884
"parking_lot",
885
-
"rand",
885
+
"rand 0.10.0",
886
886
"rand_distr",
887
887
"rapidhash",
888
888
"tracing",
···
969
969
name = "nailrng"
970
970
version = "0.1.0"
971
971
dependencies = [
972
-
"getrandom 0.3.4",
973
-
"rand_core",
972
+
"getrandom 0.4.1",
973
+
"rand_core 0.10.0",
974
974
"wyrand",
975
975
]
976
976
···
1051
1051
"nailkov",
1052
1052
"nailrng",
1053
1053
"nailspicy",
1054
-
"rand",
1054
+
"rand 0.10.0",
1055
1055
]
1056
1056
1057
1057
[[package]]
···
1213
1213
"futures-util",
1214
1214
"opentelemetry",
1215
1215
"percent-encoding",
1216
-
"rand",
1216
+
"rand 0.9.2",
1217
1217
"thiserror",
1218
1218
"tokio",
1219
1219
"tokio-stream",
···
1377
1377
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
1378
1378
dependencies = [
1379
1379
"rand_chacha",
1380
-
"rand_core",
1380
+
"rand_core 0.9.5",
1381
1381
]
1382
1382
1383
1383
[[package]]
1384
+
name = "rand"
1385
+
version = "0.10.0"
1386
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1387
+
checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8"
1388
+
dependencies = [
1389
+
"getrandom 0.4.1",
1390
+
"rand_core 0.10.0",
1391
+
]
1384
1392
1393
+
[[package]]
1385
1394
1386
1395
1396
+
1387
1397
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
1388
1398
dependencies = [
1389
1399
"ppv-lite86",
1390
-
"rand_core",
1400
+
"rand_core 0.9.5",
1391
1401
]
1392
1402
1393
1403
[[package]]
···
1400
1410
]
1401
1411
1402
1412
[[package]]
1413
+
name = "rand_core"
1414
+
version = "0.10.0"
1415
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1416
+
checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba"
1417
+
1418
+
[[package]]
1403
1419
name = "rand_distr"
1404
-
version = "0.5.1"
1420
+
version = "0.6.0"
1405
1421
source = "registry+https://github.com/rust-lang/crates.io-index"
1406
-
checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463"
1422
+
checksum = "4d431c2703ccf129de4d45253c03f49ebb22b97d6ad79ee3ecfc7e3f4862c1d8"
1407
1423
dependencies = [
1408
1424
"num-traits",
1409
-
"rand",
1425
+
"rand 0.10.0",
1410
1426
]
1411
1427
1412
1428
[[package]]
···
1415
1431
source = "registry+https://github.com/rust-lang/crates.io-index"
1416
1432
checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59"
1417
1433
dependencies = [
1418
-
"rand",
1434
+
"rand 0.9.2",
1419
1435
"rustversion",
1420
1436
]
1421
1437
···
1940
1956
dependencies = [
1941
1957
"getrandom 0.4.1",
1942
1958
"js-sys",
1943
-
"rand",
1959
+
"rand 0.9.2",
1944
1960
"wasm-bindgen",
1945
1961
]
1946
1962
···
2282
2298
2283
2299
[[package]]
2284
2300
name = "wyrand"
2285
-
version = "0.3.2"
2301
+
version = "0.4.1"
2286
2302
source = "registry+https://github.com/rust-lang/crates.io-index"
2287
-
checksum = "15e0359b0b8d9cdef235a1fd4a8c5d02e4c9204e9fac861c14c229a8e803d1a6"
2303
+
checksum = "b5484c3d24f0e2e117d30bce6f8792e193be33e2b6e0b3f8945ccf265c56c6da"
2288
2304
dependencies = [
2289
-
"rand_core",
2305
+
"rand_core 0.10.0",
2290
2306
]
2291
2307
2292
2308
[[package]]
crates/nailrt/src/lib.rs
crates/nailrt/src/lib.rs
This file has not been changed.
+4
-4
Cargo.toml
+4
-4
Cargo.toml
···
24
24
hyper = { version = "1.6.0", default-features = false, features = ["server"] }
25
25
color-eyre = { version = "0.6.3", default-features = false }
26
26
serde = { version = "1.0.219", features = ["derive"] }
27
-
rand_core = "0.9.3"
28
-
rand = { version = "0.9", default-features = false }
29
-
rand_distr = { version = "0.5.1" }
30
-
wyrand = { version = "0.3.2" }
27
+
rand_core = "0.10"
28
+
rand = { version = "0.10", default-features = false }
29
+
rand_distr = { version = "0.6" }
30
+
wyrand = { version = "0.4" }
31
31
hashbrown = { version = "0.15.2", default-features = false, features = [
32
32
"equivalent",
33
33
"inline-more",
+1
-1
crates/nailgen/src/delay.rs
+1
-1
crates/nailgen/src/delay.rs
+5
-5
crates/nailgen/src/html_gen.rs
+5
-5
crates/nailgen/src/html_gen.rs
···
5
5
use nailconfig::NailConfig;
6
6
use nailkov::NailKov;
7
7
use nailrng::FastRng;
8
-
use rand::{Rng, RngCore, distr::Alphanumeric, seq::IndexedRandom};
8
+
use rand::{RngExt, Rng, distr::Alphanumeric, seq::IndexedRandom};
9
9
10
10
/// Provides either the minimum configured size, or a randomised value between
11
11
/// the minimum and maximum configured sizes if a maximum is available.
12
12
#[inline]
13
-
fn get_desired_size(config: &NailConfig, rng: &mut impl RngCore) -> usize {
13
+
fn get_desired_size(config: &NailConfig, rng: &mut impl Rng) -> usize {
14
14
match (
15
15
config.generator.min_paragraph_size,
16
16
config.generator.max_paragraph_size,
···
26
26
pub fn text_generator<'a>(
27
27
chain: &'a NailKov,
28
28
size: usize,
29
-
rng: &'a mut impl RngCore,
29
+
rng: &'a mut impl Rng,
30
30
) -> impl Iterator<Item = &'a u8> + 'a {
31
31
chain
32
32
.generate_tokens(rng)
···
169
169
fn paragraph<'a>(
170
170
chain: &'a NailKov,
171
171
size: usize,
172
-
rng: &'a mut impl RngCore,
172
+
rng: &'a mut impl Rng,
173
173
) -> impl Iterator<Item = &'a u8> + 'a {
174
174
b"<p>"
175
175
.iter()
···
181
181
fn header<'a>(
182
182
chain: &'a NailKov,
183
183
size: usize,
184
-
rng: &'a mut impl RngCore,
184
+
rng: &'a mut impl Rng,
185
185
) -> impl Iterator<Item = &'a u8> + 'a {
186
186
b"\n<h2>"
187
187
.iter()
+4
-4
crates/nailkov/src/lib.rs
+4
-4
crates/nailkov/src/lib.rs
···
13
13
use estr::IdentityHasher;
14
14
use indexmap::IndexMap;
15
15
use itertools::Itertools;
16
-
use rand::{RngCore, seq::IteratorRandom};
16
+
use rand::{Rng, seq::IteratorRandom};
17
17
use rand_distr::Distribution;
18
18
19
19
use distribution::{TokenWeights, TokenWeightsBuilder};
···
29
29
chain: CachePadded<IndexMap<TokenPair, TokenWeights, TokenHasher>>,
30
30
}
31
31
32
-
pub struct NailKovIter<'a, R: RngCore> {
32
+
pub struct NailKovIter<'a, R: Rng> {
33
33
rng: &'a mut R,
34
34
markov: &'a NailKov,
35
35
prev: TokenPair,
36
36
}
37
37
38
-
impl<R: RngCore> Iterator for NailKovIter<'_, R> {
38
+
impl<R: Rng> Iterator for NailKovIter<'_, R> {
39
39
type Item = Token;
40
40
41
41
#[inline]
···
52
52
53
53
impl NailKov {
54
54
#[inline]
55
-
pub fn generate_tokens<'a, R: RngCore>(&'a self, rng: &'a mut R) -> NailKovIter<'a, R> {
55
+
pub fn generate_tokens<'a, R: Rng>(&'a self, rng: &'a mut R) -> NailKovIter<'a, R> {
56
56
NailKovIter {
57
57
// A markov chain that was successfully built is never empty, so
58
58
// it will always return with a value, making unwrapping it safe to do.
+1
-1
crates/nailrng/Cargo.toml
+1
-1
crates/nailrng/Cargo.toml
+11
-8
crates/nailrng/src/lib.rs
+11
-8
crates/nailrng/src/lib.rs
···
1
1
//! A very fast, user-space RNG source in the same vein as `rand`'s `ThreadRng`. Not cryptographically secure,
2
2
//! is meant to be a very fast entropy source.
3
3
4
+
use core::convert::Infallible;
4
5
use std::cell::UnsafeCell;
5
6
6
-
use rand_core::RngCore;
7
+
use rand_core::{Rng, TryRng};
7
8
use wyrand::WyRand;
8
9
9
10
thread_local! {
···
34
35
}
35
36
}
36
37
37
-
impl RngCore for FastRng {
38
+
impl TryRng for FastRng {
39
+
type Error = Infallible;
40
+
38
41
#[inline(always)]
39
-
fn next_u32(&mut self) -> u32 {
40
-
self.0.next_u32()
42
+
fn try_next_u32(&mut self) -> Result<u32, Self::Error> {
43
+
self.0.try_next_u32()
41
44
}
42
45
43
46
#[inline(always)]
44
-
fn next_u64(&mut self) -> u64 {
45
-
self.0.next_u64()
47
+
fn try_next_u64(&mut self) -> Result<u64, Self::Error> {
48
+
self.0.try_next_u64()
46
49
}
47
50
48
51
#[inline(always)]
49
-
fn fill_bytes(&mut self, dst: &mut [u8]) {
50
-
self.0.fill_bytes(dst);
52
+
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), Infallible> {
53
+
self.0.try_fill_bytes(dst)
51
54
}
52
55
}
History
4 rounds
0 comments
1 commit
expand
collapse
Use unstable tokio to build LocalRuntime for nailrt
2/2 success
expand
collapse
expand 0 comments
pull request successfully merged
1 commit
expand
collapse
Use unstable tokio to build LocalRuntime for nailrt
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Use unstable tokio to build LocalRuntime for nailrt
1/2 failed, 1/2 timeout
expand
collapse
expand 0 comments
1 commit
expand
collapse
Use unstable tokio to build LocalRuntime for nailrt