dotenv_typed/error/
impl.rs1use super::*;
2
3impl fmt::Display for EnvError {
5 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15 match self {
16 Self::MissingKey(key) => write!(f, "{ERR_MISSING_PREFIX}{key}"),
17 Self::ParseError { key, detail } => write!(f, "{ERR_PARSE_PREFIX}{key}: {detail}"),
18 Self::InvalidSyntax { line, detail } => {
19 write!(f, "{ERR_SYNTAX_PREFIX}{line}: {detail}")
20 }
21 Self::Io(msg) => write!(f, "{ERR_IO_PREFIX}{msg}"),
22 }
23 }
24}
25
26impl Error for EnvError {}