Mention std::env::var
in env!
When searching for how to read an environment variable, I first encountered the `env!` macro. It would have been useful to me if the documentation had included a link to `std::env::var`, which is what I was actually looking for.
This commit is contained in:
parent
2ed6786404
commit
4f08d75375
1 changed files with 8 additions and 2 deletions
|
@ -909,7 +909,10 @@ pub(crate) mod builtin {
|
|||
/// Inspects an environment variable at compile time.
|
||||
///
|
||||
/// This macro will expand to the value of the named environment variable at
|
||||
/// compile time, yielding an expression of type `&'static str`.
|
||||
/// compile time, yielding an expression of type `&'static str`. Use
|
||||
/// [`std::env::var`] instead if you want to read the value at runtime.
|
||||
///
|
||||
/// [`std::env::var`]: ../std/env/fn.var.html
|
||||
///
|
||||
/// If the environment variable is not defined, then a compilation error
|
||||
/// will be emitted. To not emit a compile error, use the [`option_env!`]
|
||||
|
@ -950,7 +953,10 @@ pub(crate) mod builtin {
|
|||
/// expand into an expression of type `Option<&'static str>` whose value is
|
||||
/// `Some` of the value of the environment variable. If the environment
|
||||
/// variable is not present, then this will expand to `None`. See
|
||||
/// [`Option<T>`][Option] for more information on this type.
|
||||
/// [`Option<T>`][Option] for more information on this type. Use
|
||||
/// [`std::env::var`] instead if you want to read the value at runtime.
|
||||
///
|
||||
/// [`std::env::var`]: ../std/env/fn.var.html
|
||||
///
|
||||
/// A compile time error is never emitted when using this macro regardless
|
||||
/// of whether the environment variable is present or not.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue