#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("io error: {0}")]
IoErr(#[from] ::std::io::Error),
#[error("line {0} is missing a space and so cannot be properly split")]
InvalidLine(usize),
#[error("rule parse error: {0}")]
RuleParseError(#[from] ParseError),
}
pub type Result<T> = ::std::result::Result<T, Error>;
#[derive(Debug, Clone, thiserror::Error, PartialEq)]
pub enum ParseError {
#[error("Expected stress marker '0', '1', or '2', got {0}")]
ExpectedStress(char),
#[error("Expected {0}, got EOF")]
UnexpectedEOF(&'static str),
#[error("Expected {0} after {1}, got EOF")]
UnexpectedEOFAfter(&'static str, &'static str),
#[error("Expected {0}, got {1}")]
UnexpectedCharacter(&'static str, char),
#[error("Expected {0} after {1}, got {2}")]
UnexpectedCharacterAfter(&'static str, &'static str, char),
}
pub type ParseResult<T> = ::std::result::Result<T, ParseError>;