use std::{
fs,
io::{self, Write},
path::Path,
};
use anyhow::Context;
pub fn write_to_file(path: &Path, data: &[u8]) -> anyhow::Result<()> {
fs::write(path, data).with_context(|| format!("could not write data to {}", path.display()))
}
pub fn write_to_stdout(data: &[u8]) -> anyhow::Result<()> {
io::stdout()
.write_all(data)
.context("could not write data to standard output")
}