Serialize a JSON value to bytes, mapping serialization failure to an IO error so callers can use `?` against `std::io::Result`.
(value: &serde_json::Value)
| 317 | /// Serialize a JSON value to bytes, mapping serialization failure to an IO error |
| 318 | /// so callers can use `?` against `std::io::Result`. |
| 319 | fn json_to_vec(value: &serde_json::Value) -> std::io::Result<Vec<u8>> { |
| 320 | serde_json::to_vec(value).map_err(std::io::Error::other) |
| 321 | } |
| 322 | |
| 323 | #[cfg(test)] |
| 324 | mod tests { |
no outgoing calls
no test coverage detected