fix: Fix missing Write trait and unused imports
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user