diff --git a/grovedb/Cargo.toml b/grovedb/Cargo.toml index 492666c0..f84735c0 100644 --- a/grovedb/Cargo.toml +++ b/grovedb/Cargo.toml @@ -51,9 +51,9 @@ name = "insertion_benchmark" harness = false [features] -default = ["full", "serde-support"] +default = ["full"] proof_debug = ["grovedb-merk/proof_debug"] -serde-support = ["serde", "grovedb-merk/serde-support", "indexmap/serde"] +serde = ["dep:serde", "grovedb-merk/serde", "indexmap/serde"] full = [ "grovedb-merk/full", "thiserror", diff --git a/grovedb/src/element/mod.rs b/grovedb/src/element/mod.rs index afeadc26..9986c624 100644 --- a/grovedb/src/element/mod.rs +++ b/grovedb/src/element/mod.rs @@ -30,8 +30,6 @@ use grovedb_merk::estimated_costs::SUM_VALUE_EXTRA_COST; use grovedb_merk::estimated_costs::{LAYER_COST_SIZE, SUM_LAYER_COST_SIZE}; #[cfg(feature = "full")] use grovedb_visualize::visualize_to_vec; -#[cfg(feature = "serde-support")] -use serde::{Deserialize, Serialize}; use crate::operations::proof::util::hex_to_ascii; #[cfg(any(feature = "full", feature = "verify"))] @@ -73,10 +71,7 @@ pub type SumValue = i64; /// of how serialization works. #[derive(Clone, Encode, Decode, PartialEq, Eq, Hash)] #[cfg_attr(not(any(feature = "full", feature = "visualize")), derive(Debug))] -#[cfg_attr( - feature = "serde-support", - derive(serde::Serialize, serde::Deserialize) -)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Element { /// An ordinary value Item(Vec, Option), diff --git a/grovedb/src/query/mod.rs b/grovedb/src/query/mod.rs index ed3a49ca..07930c4e 100644 --- a/grovedb/src/query/mod.rs +++ b/grovedb/src/query/mod.rs @@ -14,8 +14,6 @@ use grovedb_merk::proofs::query::{Key, SubqueryBranch}; use grovedb_merk::proofs::Query; use grovedb_version::{check_grovedb_v0, error::GroveVersionError, version::GroveVersion}; use indexmap::IndexMap; -#[cfg(feature = "serde-support")] -use serde::{Deserialize, Serialize}; use crate::operations::proof::util::hex_to_ascii; #[cfg(any(feature = "full", feature = "verify"))] @@ -25,10 +23,7 @@ use crate::Error; #[cfg(any(feature = "full", feature = "verify"))] #[derive(Debug, Clone, PartialEq, Encode, Decode)] -#[cfg_attr( - feature = "serde-support", - derive(serde::Serialize, serde::Deserialize) -)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Path query /// /// Represents a path to a specific GroveDB tree and a corresponding query to @@ -56,10 +51,7 @@ impl fmt::Display for PathQuery { #[cfg(any(feature = "full", feature = "verify"))] #[derive(Debug, Clone, PartialEq, Encode, Decode)] -#[cfg_attr( - feature = "serde-support", - derive(serde::Serialize, serde::Deserialize) -)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Holds a query to apply to a tree and an optional limit/offset value. /// Limit and offset values affect the size of the result set. pub struct SizedQuery { diff --git a/grovedb/src/reference_path.rs b/grovedb/src/reference_path.rs index 6610db89..fcfeee6e 100644 --- a/grovedb/src/reference_path.rs +++ b/grovedb/src/reference_path.rs @@ -14,10 +14,7 @@ use crate::Error; #[cfg(any(feature = "full", feature = "verify"))] #[cfg_attr(not(any(feature = "full", feature = "visualize")), derive(Debug))] -#[cfg_attr( - feature = "serde-support", - derive(serde::Serialize, serde::Deserialize) -)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Reference path variants #[derive(Hash, Eq, PartialEq, Encode, Decode, Clone)] pub enum ReferencePathType { diff --git a/merk/Cargo.toml b/merk/Cargo.toml index 11db75fa..cdb47bdf 100644 --- a/merk/Cargo.toml +++ b/merk/Cargo.toml @@ -57,7 +57,7 @@ optional = true [features] default = ["full"] proof_debug = [] -serde-support = ["serde", "indexmap/serde"] +serde = ["dep:serde", "indexmap/serde"] full = ["rand", "time", "colored", diff --git a/merk/src/proofs/query/mod.rs b/merk/src/proofs/query/mod.rs index b35d9171..b1543153 100644 --- a/merk/src/proofs/query/mod.rs +++ b/merk/src/proofs/query/mod.rs @@ -69,10 +69,7 @@ pub type PathKey = (Path, Key); #[cfg(any(feature = "full", feature = "verify"))] #[derive(Debug, Default, Clone, PartialEq, Encode, Decode)] -#[cfg_attr( - feature = "serde-support", - derive(serde::Serialize, serde::Deserialize) -)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Subquery branch pub struct SubqueryBranch { /// Subquery path @@ -115,10 +112,7 @@ impl SubqueryBranch { /// `Query` represents one or more keys or ranges of keys, which can be used to /// resolve a proof which will include all the requested values. #[derive(Debug, Default, Clone, PartialEq)] -#[cfg_attr( - feature = "serde-support", - derive(serde::Serialize, serde::Deserialize) -)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Query { /// Items pub items: Vec,