(path: &Path)
| 9505 | } |
| 9506 | |
| 9507 | fn decode_zstd_file(path: &Path) -> Result<Vec<u8>> { |
| 9508 | let file = fs::File::open(path).with_context(|| format!("open {}", path.display()))?; |
| 9509 | let mut decoder = zstd::stream::read::Decoder::new(file) |
| 9510 | .with_context(|| format!("create zstd decoder for {}", path.display()))?; |
| 9511 | let mut raw = Vec::new(); |
| 9512 | io::copy(&mut decoder, &mut raw).with_context(|| format!("decompress {}", path.display()))?; |
| 9513 | Ok(raw) |
| 9514 | } |
| 9515 | |
| 9516 | fn sha256_bytes(bytes: &[u8]) -> String { |
| 9517 | let mut hasher = Sha256::new(); |
no outgoing calls
no test coverage detected