rsmorphy 0.4.0

Morphological analyzer / inflection engine for Russian and Ukrainian (soon) languages (WIP)
use std::num::ParseFloatError;
use std::num::ParseIntError;

#[derive(Debug, Clone, PartialEq)]
pub enum DecodeError {
    /// A decoder expects more
    UnexpectedEnd,
    /// An unexpected type code reached
    UnknownPartType,
    /// An input doesnt match the current pattern
    DoesntMatch,
    /// The number decoder failed to parse an integer
    ParseIntError(ParseIntError),
    /// The number decoder failed to parse a float
    ParseFloatError(ParseFloatError),
}

impl From<ParseIntError> for DecodeError {
    fn from(e: ParseIntError) -> Self {
        DecodeError::ParseIntError(e)
    }
}

impl From<ParseFloatError> for DecodeError {
    fn from(e: ParseFloatError) -> Self {
        DecodeError::ParseFloatError(e)
    }
}