fix: Fix missing Write trait and unused imports
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use log::*;
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::path::PathBuf;
|
||||
use std::io::Write;
|
||||
|
||||
use lz4_flex::frame::{FrameDecoder, FrameEncoder};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use anyhow::Result;
|
||||
use log::*;
|
||||
use std::io::Write;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::io;
|
||||
|
||||
Reference in New Issue
Block a user