Problem
Given a newtype struct wrapping a HashMap:
pub struct MyStruct(pub HashMap<String, ByteBuf>);
The library is incorrectly serializing it as a 1-element array containing a map (CBOR major type 4), rather than transparently as just the map itself (CBOR major type 5).
Before fix:
- CBOR output:
[129, 162, ...] = 0x81 (array with 1 element) + 0xA2 (map with 2 entries)
- Major type: 4 (array) ❌
Expected:
- CBOR output:
[162, ...] = 0xA2 (map with 2 entries)
- Major type: 5 (map) ✓
Problem
Given a newtype struct wrapping a HashMap:
The library is incorrectly serializing it as a 1-element array containing a map (CBOR major type 4), rather than transparently as just the map itself (CBOR major type 5).
Before fix:
[129, 162, ...]=0x81(array with 1 element) +0xA2(map with 2 entries)Expected:
[162, ...]=0xA2(map with 2 entries)