dotenv-typed 11.2.0

Zero-dependency .env file parser, variable interpolation engine, typed environment configuration loader, and secret-redacting Debug wrapper.
Documentation
use super::*;

/// Formats [`EnvError`] into a human-readable diagnostic message.
impl fmt::Display for EnvError {
    /// Writes the diagnostic text to `f`.
    ///
    /// # Arguments
    ///
    /// - `&mut fmt::Formatter<'_>` - Destination formatter.
    ///
    /// # Returns
    ///
    /// - `fmt::Result` - Formatting outcome.
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::MissingKey(key) => write!(f, "{ERR_MISSING_PREFIX}{key}"),
            Self::ParseError { key, detail } => write!(f, "{ERR_PARSE_PREFIX}{key}: {detail}"),
            Self::InvalidSyntax { line, detail } => {
                write!(f, "{ERR_SYNTAX_PREFIX}{line}: {detail}")
            }
            Self::Io(msg) => write!(f, "{ERR_IO_PREFIX}{msg}"),
        }
    }
}

/// Marks [`EnvError`] as a standard error.
impl Error for EnvError {}