fix: Fix missing Write trait and unused imports

This commit is contained in:
Andrew Phillips (aider)
2025-05-12 20:41:18 -03:00
parent 8d7a1c2eb8
commit 712a820eba
3 changed files with 14 additions and 7 deletions

View File

@@ -1,7 +1,5 @@
use std::io::Write;
use anyhow::{anyhow, Result};
use std::io;
use log::*;
use lazy_static::lazy_static;
@@ -36,11 +34,23 @@ pub trait DigestEngine {
fn update(&mut self, data: &[u8]);
}
use std::io::Write;
// Writer that implements Write for the program digest engine
struct ProgramWriter {
stdin: std::process::ChildStdin,
}
impl Write for ProgramWriter {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
self.stdin.write(buf)
}
fn flush(&mut self) -> std::io::Result<()> {
self.stdin.flush()
}
}
lazy_static! {
pub static ref DIGEST_PROGRAMS: EnumMap<DigestType, Option<DigestEngineProgram>> = enum_map! {
DigestType::Sha256 => None,