MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / named_roundtrip

Method named_roundtrip

tests/runtime/map/test.rs:12–21  ·  view source on GitHub ↗
(a: NamesById)

Source from the content-addressed store, hash-verified

10
11impl exports::test::maps::to_test::Guest for Component {
12 fn named_roundtrip(a: NamesById) -> IdsByName {
13 assert_eq!(a.get(&1).map(String::as_str), Some("uno"));
14 assert_eq!(a.get(&2).map(String::as_str), Some("two"));
15
16 let mut result = IdsByName::new();
17 for (id, name) in a {
18 result.insert(name, id);
19 }
20 result
21 }
22
23 fn bytes_roundtrip(a: BytesByName) -> BytesByName {
24 assert_eq!(

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected