TheNeikos / envious

Deserialize (potentially nested) environment variables into your custom structs
Apache License 2.0
60 stars 2 forks source link

Shall it expose a function to deserialize from any iterator of string pairts, not just `std::env`? #9

Closed vi closed 1 year ago

vi commented 1 year ago

Apart from from_env, shall there be "IO-less" (and maybe no_std-friendly) variant that takes generic (String, String) IntoIterator instead of specifically real environment variables.

This would make testing or e.g. using environment list loaded from a file easier.

TheNeikos commented 1 year ago

Sounds like a good addition, I think it should be close to the from_env function, where it takes both a prefix and an IntoIterator.

https://github.com/TheNeikos/envious/blob/45da439009e73a6e649f82a6df0922c118f1041c/src/lib.rs#L129-L142