From 842ddd63acb9e5fbe4e936c605ef737e62063f4c Mon Sep 17 00:00:00 2001 From: Farhad Shabani Date: Thu, 30 Nov 2023 20:03:20 -0800 Subject: [PATCH 1/4] imp: fixed-hash allow opting out rand when std enabled --- fixed-hash/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index 337dad70..abbd3236 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -29,7 +29,8 @@ 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"] +rand = ["dep:rand"] api-dummy = [] # Feature used by docs.rs to display documentation of hash types From 37d1f27e31aeb1463b34ea404531f86e141e13bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 1 Dec 2023 12:05:07 +0100 Subject: [PATCH 2/4] Update fixed-hash/Cargo.toml --- fixed-hash/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index abbd3236..41829cc0 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -30,7 +30,6 @@ 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"] -rand = ["dep:rand"] api-dummy = [] # Feature used by docs.rs to display documentation of hash types From a89fa8f34b6104526a8cffc95e3cccb36985017c Mon Sep 17 00:00:00 2001 From: Farhad Shabani Date: Tue, 5 Dec 2023 11:43:23 -0800 Subject: [PATCH 3/4] fix: cargo test --no-default-features --- fixed-hash/Cargo.toml | 3 ++- primitive-types/Cargo.toml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index 41829cc0..ce78d8f3 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"] @@ -30,6 +30,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"] +rand = ["dep:rand"] 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 126b17dc..0d6dee58 100644 --- a/primitive-types/Cargo.toml +++ b/primitive-types/Cargo.toml @@ -22,8 +22,9 @@ schemars = { version = ">=0.8.12", default-features = true, optional = true } num-traits = "0.2" [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"] From c33b35d1023a7462c09bfb8a36f717205448b572 Mon Sep 17 00:00:00 2001 From: ordian Date: Tue, 5 Dec 2023 23:32:46 +0100 Subject: [PATCH 4/4] Update fixed-hash/Cargo.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- fixed-hash/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/fixed-hash/Cargo.toml b/fixed-hash/Cargo.toml index ce78d8f3..b1023533 100644 --- a/fixed-hash/Cargo.toml +++ b/fixed-hash/Cargo.toml @@ -30,7 +30,6 @@ 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"] -rand = ["dep:rand"] api-dummy = [] # Feature used by docs.rs to display documentation of hash types