Skip to content

chore: replace dotenvy with dotenvor#1250

Merged
JohnTitor merged 1 commit intoactix:mainfrom
JohnTitor:dotenvor
Feb 27, 2026
Merged

chore: replace dotenvy with dotenvor#1250
JohnTitor merged 1 commit intoactix:mainfrom
JohnTitor:dotenvor

Conversation

@JohnTitor
Copy link
Member

dotenvy's last release was made almost 3 years ago, and the last commit is over 1 year ago.
As I'm not sure if it'll be revived in the future, I've created a small dotenv crate for examples.
unsafe required because of edition 2024.

@JohnTitor JohnTitor added this pull request to the merge queue Feb 27, 2026
Merged via the queue into actix:main with commit 8e97255 Feb 27, 2026
3 checks passed
@JohnTitor JohnTitor deleted the dotenvor branch February 27, 2026 09:26
@robjtede
Copy link
Member

robjtede commented Feb 27, 2026

this being a repo which people often copy from blindly, i don't agree with us adding a dependency which requires unsafe in so many projects

@JohnTitor
Copy link
Member Author

@robjtede
Note that it was already unsafe technically even with dotenvy, it just doesn't expose unsafety. See: https://doc.rust-lang.org/edition-guide/rust-2024/newly-unsafe-functions.html#stdenvset_var-remove_var
But I'm agree with your concern and I'll explore a similar solution in allan2/dotenvy#112.

@JohnTitor
Copy link
Member Author

JohnTitor commented Mar 9, 2026

@robjtede I've been thinking this for a while but it's a bit difficult to make a choise and I'd like to hear your thoughts.
If we prefer in-memory loading way, it doesn't work well with other libs like DB drivers which need env-loading strictly.
If we prefer proc-macros (or a way like dotenvy), it just hides unsafety, but user still needs to ensure on env processing.
I think it's the best way just to use unsafe methods here, it aligns why Rust makes it unsafe.

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.

2 participants