1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use std::fmt::{self, Debug, Formatter};
/// Result of text progress
pub type Result<T> = std::result::Result<T, TextError>;
/// Error of text progress
pub enum TextError {
/// UnescapeError
UnescapeError(usize, Box<str>),
}
impl Debug for TextError {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self {
TextError::UnescapeError(p, c) => write!(f, "UnescapeError: Fail to unescape {} at position {}", c, p),
}
}
}