Debian Codegraph @

third_party/rust/wgpu-types/src/env.rs

raw
1 use alloc::string::String;
2
3 /// No-std friendly version of `std::env::var`. Returns `None` if the environment variable is not set
4 /// or we are in a no-std context.
5 pub fn var(_key: &str) -> Option<String> {
6 #[cfg(feature = "std")]
7 return std::env::var(_key).ok();
8
9 #[cfg(not(feature = "std"))]
10 return None;
11 }