feat: add thiserror and derive_more for error handling and boilerplate reduction
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user