Skip to content

Commit

Permalink
fix: enable visualized debug of elements by enabling features
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Apr 4, 2024
1 parent d007bed commit f7f26f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion grovedb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ full = [
"bincode",
"serde/derive",
"grovedb-storage/rocksdb_storage",
"grovedb-visualize",
"visualize",
"hex",
"itertools",
"integer-encoding",
Expand All @@ -56,6 +56,9 @@ full = [
"indexmap",
"intmap"
]
visualize = [
"grovedb-visualize",
]
verify = [
"grovedb-merk/verify",
"grovedb-costs",
Expand Down
3 changes: 2 additions & 1 deletion grovedb/src/element/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pub type SumValue = i64;
/// ONLY APPEND TO THIS LIST!!! Because
/// of how serialization works.
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[cfg_attr(not(any(feature = "full", feature = "visualize")), derive(Debug))]
pub enum Element {
/// An ordinary value
Item(Vec<u8>, Option<ElementFlags>),
Expand All @@ -109,7 +110,7 @@ pub enum Element {
SumTree(Option<Vec<u8>>, SumValue, Option<ElementFlags>),
}

#[cfg(feature = "full")]
#[cfg(any(feature = "full", feature = "visualize"))]
impl fmt::Debug for Element {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut v = Vec::new();
Expand Down

0 comments on commit f7f26f9

Please sign in to comment.