https://github.com/bend-n/env
std::env::set_var safely
https://github.com/bend-n/env
Last synced: 9 days ago
JSON representation
std::env::set_var safely
- Host: GitHub
- URL: https://github.com/bend-n/env
- Owner: bend-n
- Created: 2025-01-13T08:12:05.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-01-13T08:15:20.000Z (3 months ago)
- Last Synced: 2025-04-14T10:05:36.221Z (9 days ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `env`

Provides a safe interface for
[std::env](http://doc.rust-lang.org/std/env)::{[set_var](https://doc.rust-lang.org/std/env/fn.set_var.html), [remove_var](https://doc.rust-lang.org/std/env/fn.remove_var.html)}
.## Rationale
Since [#124636](https://github.com/rust-lang/rust/pull/124636), `std::env::set_var` and `std::env::remove_var}` have become unsafe, due to their being unsafe when in a multi-threaded unix context[^1].
This crate wraps these functions, adding runtime checks to ensure thread safety on unix systems, making them safe again.
[^1]: https://github.com/rust-lang/rust/issues/27970