File size: 554 Bytes
07bbbbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Re-export ZdbError for convenience
pub use mdx::{ZdbError, Result};

// Type alias for backward compatibility
pub type MdictAppError = ZdbError;

/// Helper trait for converting Result<T> to Result<T, String>
/// Used by Tauri commands to convert errors to strings
pub trait IntoStringResult<T> {
    fn into_string_result(self) -> std::result::Result<T, String>;
}

impl<T> IntoStringResult<T> for Result<T> {
    fn into_string_result(self) -> std::result::Result<T, String> {
        self.map_err(|e| crate::error_printer::format_error(&e))
    }
}