Skip to content

Commit

Permalink
style: ugly serialize impl (#6389)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 21, 2023
1 parent e38d8c6 commit 3afbc33
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions crates/evm/core/src/fork/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,10 @@ impl Serialize for JsonBlockCacheData {
{
let mut map = serializer.serialize_map(Some(4))?;

let meta = self.meta.read();
map.serialize_entry("meta", &*meta)?;
drop(meta);

let accounts = self.data.accounts.read();
map.serialize_entry("accounts", &*accounts)?;
drop(accounts);

let storage = self.data.storage.read();
map.serialize_entry("storage", &*storage)?;
drop(storage);

let block_hashes = self.data.block_hashes.read();
map.serialize_entry("block_hashes", &*block_hashes)?;
drop(block_hashes);
map.serialize_entry("meta", &*self.meta.read())?;
map.serialize_entry("accounts", &*self.data.accounts.read())?;
map.serialize_entry("storage", &*self.data.storage.read())?;
map.serialize_entry("block_hashes", &*self.data.block_hashes.read())?;

map.end()
}
Expand Down

0 comments on commit 3afbc33

Please sign in to comment.