-
Notifications
You must be signed in to change notification settings - Fork 47
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
More idiomatic code #57
base: master
Are you sure you want to change the base?
Conversation
None of them really use it to convert Result to Option
Codecov Report
@@ Coverage Diff @@
## master #57 +/- ##
=======================================
Coverage 86.77% 86.77%
=======================================
Files 7 7
Lines 242 242
=======================================
Hits 210 210
Misses 32 32
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative to .ok()
is interesting! I admit this syntax does seem like more idiomatic Rust, rather than just kinda hiding the must_use
annotation on Result
s. I wonder if users will find the change jarring though... Personally I like it ^^
Do you expect me do anything here, e.g. leave that commit out for now? |
Sorry for being vague: I'm not a maintainer of this repository, so there's no need to follow my recommendations. I am hoping the Btw, there's an equivalent |
Yes, the |
Ping @ZoeyR |
I am without computer and decent internet for a bit. I'll start working on PRs once I have those in place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, there are just two places where some extra whitespace was accidentally removed.
Ping @ZoeyR |
@ZoeyR any chances you could have another look at this soon, or add another maintainer to the dotenv-rs org? |
I find it jarring, and think |
In projects where I don't want random crashes, I use dotenv like this: match dotenv() {
Ok(_) => (),
Err(ref err) if err.not_found() => (),
Err(e) => return Err(e.into()),
} I would very much prefer to just have: dotenv()?; ... but I do not want an error if there is no |
The following is also duplicated in the changelog. - `dotenv` crate forked as `dotenvy` - `dotenv_codegen` forked as `dotenvy_codgen` - `dotenv_codegen_implementation` forked as `dotenvy_codegen_impl` - Crate description for dotenvy_codegen - Crate description for dotenvy_codgen_impl - New language in README - MIT license badge in README - Generate helpful errors from dotenv! macro (full merge of [dotenv-rs/dotenv #58](https://github.com/dotenv-rs/dotenv/pull/57/files#)) - replaced deprecated `std::env_home:dir()` with `dirs:home_dir` - Better handling of `home_dir` (merge of [dotenv-rs/dotenv #62](https://github.com/dotenv-rs/dotenv/pull/62/files#)) - assertions dealing with `Result` (based on [dotenv-rs/dotenv #57](https://github.com/dotenv-rs/dotenv/pull/57/files#)) - upgraded clap in `dotenvy` bin from v2 to v3.1 (covers [dotenv-rs/dotenv #76](https://github.com/dotenv-rs/dotenv/pull/76/files)) - example folder. The simple example has been moved to the README. - `extern` - unnecessary `use` statements in doc examples
@allan2's repo is now considered the new upstream, so just use it instead of this repo. |
Are these clear enough the way they are or should any of the changes have more explanation?