Switch to fastrand to reduce dependency count

See 35c204d7c2/CHANGELOG.md (L151-L152)
This commit is contained in:
Laurenz 2025-03-11 11:30:23 +01:00
parent a2928ed301
commit 82ffc61d59
4 changed files with 12 additions and 61 deletions

66
Cargo.lock generated
View File

@ -1389,8 +1389,8 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "636860251af8963cc40f6b4baadee105f02e21b28131d76eba8e40ce84ab8064" checksum = "636860251af8963cc40f6b4baadee105f02e21b28131d76eba8e40ce84ab8064"
dependencies = [ dependencies = [
"rand 0.8.5", "rand",
"rand_chacha 0.3.1", "rand_chacha",
] ]
[[package]] [[package]]
@ -1771,7 +1771,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
dependencies = [ dependencies = [
"phf_shared", "phf_shared",
"rand 0.8.5", "rand",
] ]
[[package]] [[package]]
@ -1873,7 +1873,7 @@ version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
dependencies = [ dependencies = [
"zerocopy 0.7.35", "zerocopy",
] ]
[[package]] [[package]]
@ -1958,18 +1958,7 @@ version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [ dependencies = [
"rand_core 0.6.4", "rand_core",
]
[[package]]
name = "rand"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.3",
"zerocopy 0.8.21",
] ]
[[package]] [[package]]
@ -1979,17 +1968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [ dependencies = [
"ppv-lite86", "ppv-lite86",
"rand_core 0.6.4", "rand_core",
]
[[package]]
name = "rand_chacha"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
"rand_core 0.9.3",
] ]
[[package]] [[package]]
@ -1998,15 +1977,6 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
[[package]]
name = "rand_core"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
"getrandom 0.3.1",
]
[[package]] [[package]]
name = "rayon" name = "rayon"
version = "1.10.0" version = "1.10.0"
@ -2926,12 +2896,12 @@ dependencies = [
"dirs", "dirs",
"ecow", "ecow",
"env_proxy", "env_proxy",
"fastrand",
"flate2", "flate2",
"fontdb", "fontdb",
"native-tls", "native-tls",
"once_cell", "once_cell",
"openssl", "openssl",
"rand 0.9.0",
"serde", "serde",
"serde_json", "serde_json",
"tar", "tar",
@ -3754,16 +3724,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"zerocopy-derive 0.7.35", "zerocopy-derive",
]
[[package]]
name = "zerocopy"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478"
dependencies = [
"zerocopy-derive 0.8.21",
] ]
[[package]] [[package]]
@ -3777,17 +3738,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "zerocopy-derive"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "zerofrom" name = "zerofrom"
version = "0.1.5" version = "0.1.5"

View File

@ -55,6 +55,7 @@ ctrlc = "3.4.1"
dirs = "6" dirs = "6"
ecow = { version = "0.2", features = ["serde"] } ecow = { version = "0.2", features = ["serde"] }
env_proxy = "0.4" env_proxy = "0.4"
fastrand = "2.3"
flate2 = "1" flate2 = "1"
fontdb = { version = "0.21", default-features = false } fontdb = { version = "0.21", default-features = false }
fs_extra = "1.3" fs_extra = "1.3"
@ -93,7 +94,6 @@ proc-macro2 = "1"
pulldown-cmark = "0.9" pulldown-cmark = "0.9"
qcms = "0.3.0" qcms = "0.3.0"
quote = "1" quote = "1"
rand = "0.9"
rayon = "1.7.0" rayon = "1.7.0"
regex = "1" regex = "1"
regex-syntax = "0.8" regex-syntax = "0.8"

View File

@ -19,6 +19,7 @@ typst-utils = { workspace = true }
dirs = { workspace = true, optional = true } dirs = { workspace = true, optional = true }
ecow = { workspace = true } ecow = { workspace = true }
env_proxy = { workspace = true, optional = true } env_proxy = { workspace = true, optional = true }
fastrand = { workspace = true, optional = true }
flate2 = { workspace = true, optional = true } flate2 = { workspace = true, optional = true }
fontdb = { workspace = true, optional = true } fontdb = { workspace = true, optional = true }
native-tls = { workspace = true, optional = true } native-tls = { workspace = true, optional = true }
@ -43,7 +44,7 @@ fonts = ["dep:fontdb", "fontdb/memmap", "fontdb/fontconfig"]
downloads = ["dep:env_proxy", "dep:native-tls", "dep:ureq", "dep:openssl"] downloads = ["dep:env_proxy", "dep:native-tls", "dep:ureq", "dep:openssl"]
# Add package downloading utilities, implies `downloads` # Add package downloading utilities, implies `downloads`
packages = ["downloads", "dep:dirs", "dep:flate2", "dep:tar", "dep:rand"] packages = ["downloads", "dep:dirs", "dep:flate2", "dep:tar", "dep:fastrand"]
# Embeds some fonts into the binary: # Embeds some fonts into the binary:
# - For text: Libertinus Serif, New Computer Modern # - For text: Libertinus Serif, New Computer Modern

View File

@ -201,7 +201,7 @@ impl PackageStorage {
".tmp-{}-{}-{}", ".tmp-{}-{}-{}",
spec.name, spec.name,
spec.version, spec.version,
rand::random::<u32>() fastrand::u32(..),
)); ));
let create_dir = |dir, dir_name| { let create_dir = |dir, dir_name| {