souvenir 0.4.1

Prefixed identifier library
Documentation
use std::fmt::{Display, Formatter};

/// An enum providing all possible errors generated by this crate.
#[derive(Debug)]
pub enum Error {
    /// Thrown when a string with invalid data is attempted to be parsed into
    /// an identifier.
    InvalidData,

    /// Thrown when a particular prefix was expected, but an identifier with
    /// a different prefix was provided.
    PrefixMismatch {
        expected: &'static str,
        actual: String,
    },
}

impl Display for Error {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "{self:?}")
    }
}

impl std::error::Error for Error {}