From d402d538f5c46ee186a9e15fe42291ef9df22bf1 Mon Sep 17 00:00:00 2001 From: mmagician Date: Tue, 14 Nov 2023 12:43:43 +0100 Subject: [PATCH] remove cfg(benches) attributes as that feature is no longer used --- poly-commit/src/linear_codes/mod.rs | 2 -- poly-commit/src/linear_codes/utils.rs | 16 +++++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/poly-commit/src/linear_codes/mod.rs b/poly-commit/src/linear_codes/mod.rs index e6628dd8..99c61b1e 100644 --- a/poly-commit/src/linear_codes/mod.rs +++ b/poly-commit/src/linear_codes/mod.rs @@ -29,8 +29,6 @@ mod data_structures; use data_structures::*; pub use data_structures::LinCodePCProof; -#[cfg(any(feature = "benches", test))] -pub use utils::{FieldToBytesColHasher, LeafIdentityHasher}; use utils::{calculate_t, get_indices_from_transcript, hash_column}; diff --git a/poly-commit/src/linear_codes/utils.rs b/poly-commit/src/linear_codes/utils.rs index 2d26feda..941c85e4 100644 --- a/poly-commit/src/linear_codes/utils.rs +++ b/poly-commit/src/linear_codes/utils.rs @@ -13,7 +13,7 @@ use ark_std::vec::Vec; #[cfg(not(feature = "std"))] use num_traits::Float; -#[cfg(any(feature = "benches", test))] +#[cfg(test)] use { crate::to_bytes, ark_std::{marker::PhantomData, rand::RngCore}, @@ -182,11 +182,10 @@ pub(crate) fn calculate_t( Ok(if t < codeword_len { t } else { codeword_len }) } -/// Only needed for benches and tests. -#[cfg(any(feature = "benches", test))] -pub struct LeafIdentityHasher; +#[cfg(test)] +pub(crate) struct LeafIdentityHasher; -#[cfg(any(feature = "benches", test))] +#[cfg(test)] impl CRHScheme for LeafIdentityHasher { type Input = Vec; type Output = Vec; @@ -204,9 +203,8 @@ impl CRHScheme for LeafIdentityHasher { } } -/// Only needed for benches and tests. -#[cfg(any(feature = "benches", test))] -pub struct FieldToBytesColHasher +#[cfg(test)] +pub(crate) struct FieldToBytesColHasher where F: PrimeField + CanonicalSerialize, D: Digest, @@ -214,7 +212,7 @@ where _phantom: PhantomData<(F, D)>, } -#[cfg(any(feature = "benches", test))] +#[cfg(test)] impl CRHScheme for FieldToBytesColHasher where F: PrimeField + CanonicalSerialize,