dotenvy
dotenvy copied to clipboard
`Iter` type being leaked publicly
The public functions dotenv_iter
, from_read_iter
, from_filename_iter
, and from_path_iter
all return the Iter
struct - which is currently not public. It needs to be so users have easier to access its documentation.
As a public type it needs to eagerly implement common traits (Rust API Guidelines) and have decent documentation.
Its naming could also be improved. It is clear enough in the context of a library internal, but when constructed and viewed externally Iter
is fairly nebulous. Are there any renaming suggestions?
Making Iter
public would also make from_read_iter
obsolete as all it does is call Iter::new
.
Naming: Iter
is fine, since it is namespaced by the crate. See also https://docs.rs/error-chain/latest/error_chain/struct.Iter.html
There is only one kind of Iter
in this crate, and the crate focuses on a single functionality.
Making Iter
public sounds good to me.
I would keep from_read_iter
around, at least for the time being.
So pub use iter::Iter
in the root namespace? (I'd rather not pub mod iter
, as the nested namespace is useless to library users.)
I am leaving this issue unresolved until the documentation for the type has been written. Thank you @LeoniePhiline for the starter PR.
On the v0.16 branch, I have made Iter
private.
The *_iter
functions are now deprecated. EnvLoader::load
returns HashMap
.
Does anyone object to Iter
being private?