Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add from_read and from_read_iter. #5

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

KevinMGranger
Copy link

This will allow reading env vars from any arbitrary io::Read.

Use case: I'm working on a tool to translate a dhall file into a dotenv file, and a tool to load dotenv files into the fish shell.
I'd like to run dhallenv file.dhall | fishdotenv, which requires reading a dotenv formatted stream from stdin.
(Yes, I could use from_filename_iter("/dev/stdin"), but that's a bit non-obvious, and feels a little hacky.)

I considered exposing Iter directly, but that seems like an implementation detail.

I didn't add additional unit tests because it doesn't really add any new code paths. If that's not okay, I'll happily add some.

This will allow reading env vars from any arbitrary `io::Read`.
@allan2 allan2 merged commit 13ff292 into allan2:master Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants