Skip to content

Commit

Permalink
fix: hashmap (op-rs#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored and TomTaehoonKim committed Nov 5, 2024
1 parent 8e30f2b commit bae76fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/host/src/kv/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct MemoryKeyValueStore {
impl MemoryKeyValueStore {
/// Create a new [MemoryKeyValueStore] with an empty store.
pub fn new() -> Self {
Self { store: HashMap::new() }
Self { store: HashMap::default() }
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/derive/src/stages/channel/channel_bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
/// Create a new [ChannelBank] stage.
pub fn new(cfg: Arc<RollupConfig>, prev: P) -> Self {
crate::set!(STAGE_RESETS, 0, &["channel-bank"]);
Self { cfg, channels: HashMap::new(), channel_queue: VecDeque::new(), prev }
Self { cfg, channels: HashMap::default(), channel_queue: VecDeque::new(), prev }
}

/// Returns the size of the channel bank by accumulating over all channels.
Expand Down
4 changes: 2 additions & 2 deletions crates/preimage/src/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod test {
PreimageKey::new(*keccak256(MOCK_DATA_B), PreimageKeyType::Keccak256);

let preimages = {
let mut preimages = HashMap::new();
let mut preimages = HashMap::default();
preimages.insert(key_a, MOCK_DATA_A.to_vec());
preimages.insert(key_b, MOCK_DATA_B.to_vec());
Arc::new(Mutex::new(preimages))
Expand Down Expand Up @@ -212,7 +212,7 @@ mod test {
PreimageKey::new(*keccak256(MOCK_DATA_B), PreimageKeyType::Keccak256);

let preimages = {
let mut preimages = HashMap::new();
let mut preimages = HashMap::default();
preimages.insert(key_a, MOCK_DATA_A.to_vec());
preimages.insert(key_b, MOCK_DATA_B.to_vec());
Arc::new(Mutex::new(preimages))
Expand Down

0 comments on commit bae76fb

Please sign in to comment.