Skip to main content

Module startup_env

Module startup_env 

Source
Expand description

Audited startup-time environment defaulting.

std::env::set_var is unsafe in edition 2024 because mutating the environment while other threads read it is undefined behavior on some platforms. This island exists so the CLI (a forbid(unsafe_code) crate) can install product-default switches at the top of main, before anything spawns a thread. It is the same class of tiny OS-interface island as mmap.rs.

Functionsยง

set_default_if_unset
Sets key to value unless the user already set it.