diff --git a/dotenv/src/errors.rs b/dotenv/src/errors.rs index 25616494..c3631375 100644 --- a/dotenv/src/errors.rs +++ b/dotenv/src/errors.rs @@ -6,12 +6,11 @@ use std::io; pub type Result = std::result::Result; #[derive(Debug)] +#[non_exhaustive] pub enum Error { LineParse(String, usize), Io(io::Error), EnvVar(env::VarError), - #[doc(hidden)] - __Nonexhaustive, } impl Error { @@ -43,7 +42,6 @@ impl fmt::Display for Error { "Error parsing line: '{}', error at line index: {}", line, error_index ), - _ => unreachable!(), } } } diff --git a/dotenv/src/parse.rs b/dotenv/src/parse.rs index 06fa39c7..d655a632 100644 --- a/dotenv/src/parse.rs +++ b/dotenv/src/parse.rs @@ -66,7 +66,7 @@ impl<'a> LineParser<'a> { return Ok(Some((key, String::new()))); } - let parsed_value = parse_value(self.line, &mut self.substitution_data)?; + let parsed_value = parse_value(self.line, self.substitution_data)?; self.substitution_data .insert(key.clone(), Some(parsed_value.clone()));