From c01759ff8bed8d74e4452eda8c4afbfffe6e1638 Mon Sep 17 00:00:00 2001 From: Federico Gimenez Date: Mon, 20 Jan 2025 10:30:34 +0100 Subject: [PATCH] clone -> as_ref --- crates/trie/trie/src/hashed_cursor/post_state.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/trie/trie/src/hashed_cursor/post_state.rs b/crates/trie/trie/src/hashed_cursor/post_state.rs index 11567637b3ad..59efa55785b2 100644 --- a/crates/trie/trie/src/hashed_cursor/post_state.rs +++ b/crates/trie/trie/src/hashed_cursor/post_state.rs @@ -204,7 +204,7 @@ where /// Create new instance of [`HashedPostStateStorageCursor`] for the given hashed address. pub fn new(cursor: C, post_state_storage: Option>) -> Self { let post_state_cursor = post_state_storage - .clone() + .as_ref() .map(|s| ForwardInMemoryCursor::new(Arc::new(s.non_zero_valued_slots.clone()))); let cleared_slots = post_state_storage.as_ref().map(|s| s.zero_valued_slots.clone()); let storage_wiped = post_state_storage.is_some_and(|s| s.wiped); @@ -214,7 +214,7 @@ where /// Check if the slot was zeroed out in the post state. /// The database is not checked since it already has no zero-valued slots. fn is_slot_zero_valued(&self, slot: &B256) -> bool { - self.cleared_slots.clone().is_some_and(|s| s.contains(slot)) + self.cleared_slots.as_ref().is_some_and(|s| s.contains(slot)) } /// Find the storage entry in post state or database that's greater or equal to provided subkey.