Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Oct 4, 2024
1 parent ec1d916 commit 31b7880
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 31 deletions.
4 changes: 2 additions & 2 deletions grovedb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 1 addition & 6 deletions grovedb/src/element/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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<u8>, Option<ElementFlags>),
Expand Down
12 changes: 2 additions & 10 deletions grovedb/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 1 addition & 4 deletions grovedb/src/reference_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion merk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 2 additions & 8 deletions merk/src/proofs/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<QueryItem>,
Expand Down

0 comments on commit 31b7880

Please sign in to comment.