Skip to content

Commit

Permalink
Derive trait implementation instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ekovalev committed Sep 13, 2023
1 parent 5182078 commit f9673cd
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions primitives/state-machine/src/overlayed_changes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ impl<Transaction, H: Hasher> StorageChanges<Transaction, H> {
/// Storage transactions are calculated as part of the `storage_root`.
/// These transactions can be reused for importing the block into the
/// storage. So, we cache them to not require a recomputation of those transactions.
#[derive(Clone)]
pub struct StorageTransactionCache<Transaction, H: Hasher> {
/// Contains the changes for the main and the child storages as one transaction.
pub(crate) transaction: Option<Transaction>,
Expand All @@ -197,18 +198,6 @@ impl<Transaction, H: Hasher> Default for StorageTransactionCache<Transaction, H>
}
}

impl<Transaction, H: Hasher> Clone for StorageTransactionCache<Transaction, H>
where
Transaction: Clone,
{
fn clone(&self) -> Self {
Self {
transaction: self.transaction.clone(),
transaction_storage_root: self.transaction_storage_root.clone(),
}
}
}

impl<Transaction: Default, H: Hasher> Default for StorageChanges<Transaction, H> {
fn default() -> Self {
Self {
Expand Down

0 comments on commit f9673cd

Please sign in to comment.