From 93cc5d6aed4b6c4059159eec6b85f8a613704ead Mon Sep 17 00:00:00 2001 From: Daniel Griffen Date: Tue, 14 May 2019 13:57:39 -0700 Subject: [PATCH 1/2] bump version to 0.14.1 --- dotenv/Cargo.toml | 2 +- dotenv_codegen/Cargo.toml | 2 +- dotenv_codegen_implementation/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dotenv/Cargo.toml b/dotenv/Cargo.toml index 597f8ff..b116eaa 100644 --- a/dotenv/Cargo.toml +++ b/dotenv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dotenv" -version = "0.14.0" +version = "0.14.1" authors = ["Noemi Lapresta ", "Craig Hills ", "Mike Piccolo ", "Alice Maz ", "Sean Griffin ", "Adam Sharp "] description = "A `dotenv` implementation for Rust" homepage = "https://github.com/dotenv-rs/dotenv" diff --git a/dotenv_codegen/Cargo.toml b/dotenv_codegen/Cargo.toml index 4f56de6..a2451ed 100644 --- a/dotenv_codegen/Cargo.toml +++ b/dotenv_codegen/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dotenv_codegen" -version = "0.14.0" +version = "0.14.1" authors = [ "Santiago Lapresta ", "Craig Hills ", diff --git a/dotenv_codegen_implementation/Cargo.toml b/dotenv_codegen_implementation/Cargo.toml index dc86103..20fd57c 100644 --- a/dotenv_codegen_implementation/Cargo.toml +++ b/dotenv_codegen_implementation/Cargo.toml @@ -4,7 +4,7 @@ proc-macro = true [package] name = "dotenv_codegen_implementation" -version = "0.14.0" +version = "0.14.1" authors = [ "Santiago Lapresta ", "Craig Hills ", From fe38ac72d2f5aa910e2a12415c60317ee2f0dc69 Mon Sep 17 00:00:00 2001 From: Daniel Griffen Date: Tue, 14 May 2019 13:41:30 -0700 Subject: [PATCH 2/2] deprecate `iter` methods --- dotenv/src/lib.rs | 6 +++++- dotenv/tests/test-dotenv-iter.rs | 1 + dotenv/tests/test-from-filename-iter.rs | 1 + dotenv/tests/test-from-path-iter.rs | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dotenv/src/lib.rs b/dotenv/src/lib.rs index 1707277..16837ad 100644 --- a/dotenv/src/lib.rs +++ b/dotenv/src/lib.rs @@ -79,7 +79,8 @@ pub fn vars() -> Vars { /// dotenv::from_path(my_path.as_path()); /// ``` pub fn from_path>(path: P) -> Result<()> { - from_path_iter(path)?.load() + let iter = Iter::new(File::open(path).map_err(Error::Io)?); + iter.load() } /// Like `from_path`, but returns an iterator over variables instead of loading into environment. @@ -99,6 +100,7 @@ pub fn from_path>(path: P) -> Result<()> { /// println!("{}={}", key, val); /// } /// ``` +#[deprecated(since = "0.14.1", note = "please use `from_path` in conjunction with `var` instead")] pub fn from_path_iter>(path: P) -> Result> { Ok(Iter::new(File::open(path).map_err(Error::Io)?)) } @@ -144,6 +146,7 @@ pub fn from_filename>(filename: P) -> Result { /// println!("{}={}", key, val); /// } /// ``` +#[deprecated(since = "0.14.1", note = "please use `from_path` in conjunction with `var` instead")] pub fn from_filename_iter>(filename: P) -> Result> { let (_, iter) = Finder::new().filename(filename.as_ref()).find()?; Ok(iter) @@ -174,6 +177,7 @@ pub fn dotenv() -> Result { /// println!("{}={}", key, val); /// } /// ``` +#[deprecated(since = "0.14.1", note = "please use `from_path` in conjunction with `var` instead")] pub fn dotenv_iter() -> Result> { let (_, iter) = Finder::new().find()?; Ok(iter) diff --git a/dotenv/tests/test-dotenv-iter.rs b/dotenv/tests/test-dotenv-iter.rs index 2892303..3fcc46b 100644 --- a/dotenv/tests/test-dotenv-iter.rs +++ b/dotenv/tests/test-dotenv-iter.rs @@ -6,6 +6,7 @@ use dotenv::*; use crate::common::*; #[test] +#[allow(deprecated)] fn test_dotenv_iter() { let dir = make_test_dotenv().unwrap(); diff --git a/dotenv/tests/test-from-filename-iter.rs b/dotenv/tests/test-from-filename-iter.rs index 97f8c25..cb1867b 100644 --- a/dotenv/tests/test-from-filename-iter.rs +++ b/dotenv/tests/test-from-filename-iter.rs @@ -6,6 +6,7 @@ use dotenv::*; use crate::common::*; #[test] +#[allow(deprecated)] fn test_from_filename_iter() { let dir = make_test_dotenv().unwrap(); diff --git a/dotenv/tests/test-from-path-iter.rs b/dotenv/tests/test-from-path-iter.rs index bdcb042..703825e 100644 --- a/dotenv/tests/test-from-path-iter.rs +++ b/dotenv/tests/test-from-path-iter.rs @@ -6,6 +6,7 @@ use dotenv::*; use crate::common::*; #[test] +#[allow(deprecated)] fn test_from_path_iter() { let dir = make_test_dotenv().unwrap();