normalize reading

This commit is contained in:
polv committed 2026-03-08 23:43:32 +07:00
1 parent a97da3fa1d
commit 189853cc23
10 files changed
+248 -56

No files matched your search

+11 -1
View File
@@ -6,7 +6,7 @@ use std::{
use rusqlite::Connection;
use serde::Serialize;
use thiserror::Error;
use vibrato::errors::VibratoError;
use vibrato::{Tokenizer, errors::VibratoError};
use zip::result::ZipError;
#[derive(Debug, Error, Serialize)]
@@ -39,6 +39,9 @@ pub enum CJDicError {
#[error("ConnectionMutexGuardError: {0}")]
ConnectionMutexGuardError(String),
#[error("TokenizerMutexGuardError: {0}")]
TokenizerMutexGuardError(String),
#[error("Not found")]
NotFound,
@@ -101,3 +104,10 @@ impl From<PoisonError<MutexGuard<'_, Connection>>> for CJDicError {
CJDicError::ConnectionMutexGuardError(e.to_string())
}
}
impl From<PoisonError<MutexGuard<'_, Tokenizer>>> for CJDicError {
fn from(e: PoisonError<MutexGuard<'_, Tokenizer>>) -> Self {
eprintln!("{e:#}");
CJDicError::TokenizerMutexGuardError(e.to_string())
}
}