Skip to content

Commit 37b95b0

Browse files
committed
Use HashMap in Rust
1 parent 88cb2d7 commit 37b95b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libwasmvm/src/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::BTreeSet;
1+
use std::collections::{BTreeSet, HashMap};
22
use std::convert::TryInto;
33
use std::panic::{catch_unwind, AssertUnwindSafe};
44
use std::str::from_utf8;
@@ -433,7 +433,7 @@ impl From<cosmwasm_vm::PerModuleMetrics> for PerModuleMetrics {
433433

434434
#[derive(Serialize)]
435435
struct PinnedMetrics {
436-
per_module: Vec<(Checksum, PerModuleMetrics)>,
436+
per_module: HashMap<Checksum, PerModuleMetrics>,
437437
}
438438

439439
impl From<cosmwasm_vm::PinnedMetrics> for PinnedMetrics {

types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ type PerModuleMetrics struct {
197197
}
198198

199199
type PinnedMetrics struct {
200-
PerModule map[string]PerModuleMetrics `json:"per_module" msgpack:",asarray"`
200+
PerModule map[string]PerModuleMetrics `msgpack:"per_module"`
201201
}
202202

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

0 commit comments

Comments
 (0)