diff --git a/Cargo.toml b/Cargo.toml index 572b321..e72f052 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ anyhow = "1.0.72" axum = "0.8.4" derive_more = "2.0" smart-default = "0.7" +thiserror = "1.0" base64 = "0.22.1" chrono = "0.4.26" clap = { version = "4.3.10", features = ["derive", "env"] } diff --git a/src/meta_plugin/digest.rs b/src/meta_plugin/digest.rs index b2eebbd..5bff1e1 100644 --- a/src/meta_plugin/digest.rs +++ b/src/meta_plugin/digest.rs @@ -4,24 +4,13 @@ use crate::meta_plugin::{MetaPlugin, MetaPluginType}; use std::fmt; use std::io::Write; -#[derive(Clone)] +#[derive(Clone, Debug)] enum Hasher { Md5(md5::Context), Sha256(Sha256), Sha512(Sha512), } -// Implement Debug manually since md5::Context doesn't implement it -impl fmt::Debug for Hasher { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Hasher::Md5(_) => write!(f, "Hasher::Md5"), - Hasher::Sha256(_) => write!(f, "Hasher::Sha256"), - Hasher::Sha512(_) => write!(f, "Hasher::Sha512"), - } - } -} - impl Hasher { fn update(&mut self, data: &[u8]) { match self {