expand_str
ExpandEnvironmentStrings emulation with more strict input checking and a way to substitute your own variable values.
Example
Add expand_str
to your dependencies of your Cargo.toml
:
[]
= "0.1"
And then, in your rust file:
If you only want string formatting, environment variable access code can be dropped, e.g.:
[]
= "0.1"
= false
(Exact feature name is env
, but there are no other features at the moment).
Formatting-only example: