For my project I need a function that reads ENV file and do not change the current process environment.
I found out dotenv::from_path_iter is doing exactly what is needed. Unfortunately it is marked as deprecated and it is recommended to use from_path + vars.
The problem is that from_path updates the environment but I need just to read it, I would modify the env myself.
I could have used Ok(Iter::new(File::open(path).map_err(Error::Io)?)) but Iter struct is private.
For my project I need a function that reads ENV file and do not change the current process environment.
I found out
dotenv::from_path_iter
is doing exactly what is needed. Unfortunately it is marked as deprecated and it is recommended to usefrom_path
+vars
.The problem is that
from_path
updates the environment but I need just to read it, I would modify the env myself.I could have used
Ok(Iter::new(File::open(path).map_err(Error::Io)?))
butIter
struct is private.