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:
Andrew Phillips
2025-08-27 21:45:49 -03:00
parent c056e8e2f2
commit 1025f1bc01
2 changed files with 2 additions and 12 deletions

View File

@@ -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 {