feat: Implement overriding API methods (prefer #47) #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a successor to #17
Update: To address and resolve the discussion points below, I am offering another, preferred PR at #47.
This PR
from_read()
.Discussion
Update: To address and resolve these points, I am offering another, preferred PR at #47.
Note that the API is still inconsistent, due to #41:
overload()
vs. the more consistentdotenv_overload()
Following the naming schema the public
fn overload()
should be calledfn dotenv_overload()
-- in line with the crate-wide[base]_[variant]()
pub fn
-naming scheme, e.g.dotenv()
&dotenv_iter()
.See also the sorting of public methods in the documentation, where the broken naming scheme in
overload()
makes it be placed out of context:Proper naming: Prefer "override" over "overload"
Quoted from #17 (comment):
I disagree. "override" describes the functionality much better than "overload".
I would strongly suggest going forward with "override" rather than "overload".
There is no "overloading" happening as is understood in IT. Instead, existing values are overridden by new values.
Why mention loading in
overload()
when thedotenv()
function is not namedload()
?The following naming makes the most sense:
Optionally,
_with_override()
rather than_override()
.