Skip to content

Commit 757b458

Browse files
committed
Update readme link.
1 parent 27bbb18 commit 757b458

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Eventually you will be able to do so once support for running `parse` and `unwra
2727

2828
| Feature name | Enabled by default? | Requires nightly? | Description |
2929
|---|---|---|---|
30-
| `tracked` | No | Yes | Use the unstable [proc_macro_tracked_env](https://github.com/rust-lang/rust/issues/74690) feature to inform the build system about the used environment variables. |
30+
| `tracked` | No | Yes | Use the unstable [proc_macro_tracked_env](https://github.com/rust-lang/rust/issues/99515) feature to inform the build system about the used environment variables. |
3131

3232
## Usage
3333

const_env_tests/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::sync::LazyLock;
2+
13
use const_env::{env_item, env_lit};
24

35
const USIZE_ARRAY: [usize; 3] = env_lit!("INT_ARRAY", [1, 2, 3]);
@@ -68,6 +70,10 @@ static ORIGIN: Vec2<f64> = Vec2 { x: 0., y: 0. };
6870

6971
static ORIGIN_LIT: Vec2<f32> = env_lit!("ORIGIN", Vec2 { x: 0., y: 0.});
7072

73+
static FOO: LazyLock<u32> = LazyLock::new(|| {
74+
option_env!("FOO").and_then(|foo| foo.parse().ok()).unwrap_or(0)
75+
});
76+
7177
fn main() {
7278
assert_eq!([10, 11, 12], USIZE_ARRAY);
7379
assert_eq!(["bar"], STRING_ARRAY);

0 commit comments

Comments
 (0)