Skip to content

Commit

Permalink
fmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Sep 27, 2023
1 parent 2db0b08 commit 89628d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 1 addition & 4 deletions costs/src/storage_cost/removal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ pub const UNKNOWN_EPOCH: u64 = u64::MAX;
pub type StorageRemovalPerEpochByIdentifier = BTreeMap<Identifier, IntMap<u32>>;

/// Removal bytes
#[derive(Debug, PartialEq, Clone, Eq)]
#[derive(Default)]
#[derive(Debug, PartialEq, Clone, Eq, Default)]
pub enum StorageRemovedBytes {
/// No storage removal
#[default]
Expand All @@ -61,8 +60,6 @@ pub enum StorageRemovedBytes {
SectionedStorageRemoval(StorageRemovalPerEpochByIdentifier),
}



impl Add for StorageRemovedBytes {
type Output = Self;

Expand Down
8 changes: 6 additions & 2 deletions grovedb/src/batch/estimated_costs/average_case_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ impl<G, SR> TreeCache<G, SR> for AverageCaseTreeCacheKnownPaths {
&cost,
self.paths.get(path).ok_or_else(|| {
let paths = self
.paths.keys().map(|k| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
.paths
.keys()
.map(|k| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
.join(" | ");
Error::PathNotFoundInCacheForEstimatedCosts(format!(
"required path {} not found in paths {}",
Expand All @@ -231,7 +233,9 @@ impl<G, SR> TreeCache<G, SR> for AverageCaseTreeCacheKnownPaths {
&cost,
self.paths.get(path).ok_or_else(|| {
let paths = self
.paths.keys().map(|k| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
.paths
.keys()
.map(|k| k.0.iter().map(|k| hex::encode(k.as_slice())).join("/"))
.join(" | ");
Error::PathNotFoundInCacheForEstimatedCosts(format!(
"required path for estimated merk caching {} not found in paths {}",
Expand Down
2 changes: 0 additions & 2 deletions merk/src/estimated_costs/average_case_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ pub enum EstimatedSumTrees {
}

#[cfg(feature = "full")]


#[cfg(feature = "full")]
impl EstimatedSumTrees {
fn estimated_size(&self) -> Result<u32, Error> {
Expand Down
5 changes: 1 addition & 4 deletions merk/src/merk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,7 @@ mod test {

#[test]
fn reopen_iter() {
fn collect(
iter: PrefixedStorageIter<'_, '_>,
nodes: &mut Vec<(Vec<u8>, Vec<u8>)>,
) {
fn collect(iter: PrefixedStorageIter<'_, '_>, nodes: &mut Vec<(Vec<u8>, Vec<u8>)>) {
while iter.valid().unwrap() {
nodes.push((
iter.key().unwrap().unwrap().to_vec(),
Expand Down

0 comments on commit 89628d7

Please sign in to comment.