Build a simple msgpack map from string key-value pairs.
(pairs: &[(&str, &str)])
| 277 | |
| 278 | /// Build a simple msgpack map from string key-value pairs. |
| 279 | pub fn build_str_map(pairs: &[(&str, &str)]) -> Vec<u8> { |
| 280 | let mut buf = Vec::with_capacity(pairs.len() * 32); |
| 281 | write_map_header(&mut buf, pairs.len()); |
| 282 | for (k, v) in pairs { |
| 283 | write_kv_str(&mut buf, k, v); |
| 284 | } |
| 285 | buf |
| 286 | } |
| 287 | |
| 288 | #[cfg(test)] |
| 289 | mod tests { |
nothing calls this directly
no test coverage detected