Skip to content

Commit

Permalink
Use dotenvy instead of dotenv (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-burns authored Dec 15, 2022
1 parent eb92479 commit 8ef3148
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ camino = "1.0.4"
clap = { version = "2.33.0", features = ["wrap_help"] }
ctrlc = { version = "3.1.1", features = ["termination"] }
derivative = "2.0.0"
dotenv = "0.15.0"
dotenvy = "0.15"
edit-distance = "2.0.0"
env_logger = "0.9.3"
heck = "0.4.0"
Expand Down
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub(crate) enum Error<'src> {
min_arguments: usize,
},
Dotenv {
dotenv_error: dotenv::Error,
dotenv_error: dotenvy::Error,
},
DumpJson {
serde_json_error: serde_json::Error,
Expand Down Expand Up @@ -192,8 +192,8 @@ impl<'src> From<ConfigError> for Error<'src> {
}
}

impl<'src> From<dotenv::Error> for Error<'src> {
fn from(dotenv_error: dotenv::Error) -> Error<'src> {
impl<'src> From<dotenvy::Error> for Error<'src> {
fn from(dotenv_error: dotenvy::Error) -> Error<'src> {
Self::Dotenv { dotenv_error }
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/load_dotenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ pub(crate) fn load_dotenv(
}

fn load_from_file(path: &Path) -> RunResult<'static, BTreeMap<String, String>> {
// `dotenv::from_path_iter` should eventually be un-deprecated, see:
// https://github.com/dotenv-rs/dotenv/issues/13
#![allow(deprecated)]

let iter = dotenv::from_path_iter(path)?;
let iter = dotenvy::from_path_iter(path)?;
let mut dotenv = BTreeMap::new();
for result in iter {
let (key, value) = result?;
Expand Down

0 comments on commit 8ef3148

Please sign in to comment.