(a: NamesById)
| 10 | |
| 11 | impl 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!( |