(
map: &HashMap<u32, Vec<Vec<u8>>>,
filename: &str,
)
| 397 | use std::io::Write; |
| 398 | |
| 399 | pub(crate) fn write_map_to_file( |
| 400 | map: &HashMap<u32, Vec<Vec<u8>>>, |
| 401 | filename: &str, |
| 402 | ) -> Result<(), Box<dyn Error>> { |
| 403 | // Serialize the map to a JSON string |
| 404 | let json = serde_json::to_string(map)?; |
| 405 | |
| 406 | // Write the JSON string to a file |
| 407 | let mut file = File::create(filename)?; |
| 408 | file.write_all(json.as_bytes())?; |
| 409 | Ok(()) |
| 410 | } |
| 411 | |
| 412 | #[allow(clippy::type_complexity)] |
| 413 | pub(crate) fn read_map_from_file( |
no outgoing calls
no test coverage detected