Closed Paul-E closed 7 years ago
Makes sense to combine them into one. Probably result from implementing this in phases.
I would go with the tuples. I would only do Unknown(String, u64)
as I assume in case of unknown you first want to look at the type.
One thing I find is that if the bandwidth comes first, then I can always grab the first element to get the bandwidth value, regardless of variant.
But the bandwidth numbers is completely meaningless without the type, because you don't even know if it's in bits, bytes, kilo-bytes or whatever other unit.
The
Unknown
value inSdpBandwidthType
should carry a String if SdpBandwidthType it is only ever used inSdpBandwidth
with theunknown_type
option set to the corresponding String. Thenunknown_type
in SdpBandwidth can be eliminated.Alternatively, we can simplify down to one struct. Eg:
or