From 872345513a952ab327fa1fb25d14e509c725755b Mon Sep 17 00:00:00 2001 From: Farhad Shabani Date: Tue, 5 Dec 2023 14:46:46 -0800 Subject: [PATCH] imp: in `fixed-hash` allow opting out `rand` when `std` enabled (#804) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * imp: fixed-hash allow opting out rand when std enabled * Update fixed-hash/Cargo.toml * fix: cargo test --no-default-features * Update fixed-hash/Cargo.toml Co-authored-by: Bastian Köcher --------- Co-authored-by: Bastian Köcher Co-authored-by: ordian --- fixed-hash/Cargo.toml | 4 ++-- primitive-types/Cargo.toml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index 337dad70..b1023533 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -9,7 +9,7 @@ description = "Macros to define custom fixed-size hash types" documentation = "https://docs.rs/fixed-hash/" readme = "README.md" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60" [package.metadata.docs.rs] features = ["quickcheck", "api-dummy"] @@ -29,7 +29,7 @@ rand = { version = "0.8.0", default-features = false, features = ["std_rng"] } [features] default = ["std", "rand", "rustc-hex", "byteorder"] -std = ["rustc-hex/std", "rand/std", "byteorder/std"] +std = ["rustc-hex/std", "rand?/std", "byteorder/std"] api-dummy = [] # Feature used by docs.rs to display documentation of hash types diff --git a/primitive-types/Cargo.toml b/primitive-types/Cargo.toml index 1c861d36..d7d93c4f 100644 --- a/primitive-types/Cargo.toml +++ b/primitive-types/Cargo.toml @@ -24,8 +24,9 @@ serde_json = { version = "1.0", default-features = false } jsonschema = { version = "0.17", default-features = false } [features] -default = ["std"] +default = ["std", "rand"] std = ["uint/std", "fixed-hash/std", "impl-codec?/std"] +rand = ["fixed-hash/rand"] byteorder = ["fixed-hash/byteorder"] rustc-hex = ["fixed-hash/rustc-hex"] serde = ["std", "impl-serde", "impl-serde/std"]