Download next.js/turbopack/crates/turbo-tasks-env/src/command_line.rs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbo-tasks-env/src/command_line.rs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/crates/turbo-tasks-env/src/command_line.rs
-
curl -L -o command_line.rs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbo-tasks-env/src/command_line.rs
819 Bytes
| use turbo_rcstr::RcStr; | |
| use turbo_tasks::{FxIndexMap, Vc, mark_session_dependent}; | |
| use crate::{EnvMap, GLOBAL_ENV_LOCK, ProcessEnv, sorted_env_vars}; | |
| /// Load the environment variables defined via command line. | |
| pub struct CommandLineProcessEnv; | |
| impl CommandLineProcessEnv { | |
| pub fn new() -> Vc<Self> { | |
| CommandLineProcessEnv.cell() | |
| } | |
| } | |
| /// Clones the current env vars into a FxIndexMap. | |
| fn env_snapshot() -> FxIndexMap<RcStr, RcStr> { | |
| let _lock = GLOBAL_ENV_LOCK.lock().unwrap(); | |
| sorted_env_vars() | |
| } | |
| impl ProcessEnv for CommandLineProcessEnv { | |
| fn read_all(&self) -> Vc<EnvMap> { | |
| mark_session_dependent(); | |
| Vc::cell(env_snapshot()) | |
| } | |
| } | |