Skip to content

Commit

Permalink
Use HashMap in Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Mar 19, 2024
1 parent 14ed7a9 commit 1e487c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libwasmvm/src/cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::BTreeSet;
use std::collections::{BTreeSet, HashMap};
use std::convert::TryInto;
use std::panic::{catch_unwind, AssertUnwindSafe};
use std::str::from_utf8;
Expand Down Expand Up @@ -402,7 +402,7 @@ impl From<cosmwasm_vm::PerModuleMetrics> for PerModuleMetrics {

#[derive(Serialize)]
struct PinnedMetrics {
per_module: Vec<(Checksum, PerModuleMetrics)>,
per_module: HashMap<Checksum, PerModuleMetrics>,
}

impl From<cosmwasm_vm::PinnedMetrics> for PinnedMetrics {
Expand Down
2 changes: 1 addition & 1 deletion types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ type PerModuleMetrics struct {
}

type PinnedMetrics struct {
PerModule map[string]PerModuleMetrics `json:"per_module" msgpack:",asarray"`
PerModule map[string]PerModuleMetrics `json:"per_module"`
}

func (pm *PinnedMetrics) UnmarshalMessagePack(data []byte) error {
Expand Down

0 comments on commit 1e487c3

Please sign in to comment.