MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / decode_zstd_file

Function decode_zstd_file

xtask/src/main.rs:9507–9514  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

9505}
9506
9507fn 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
9516fn sha256_bytes(bytes: &[u8]) -> String {
9517 let mut hasher = Sha256::new();

Callers 2

package_aot_artifactsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected