diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-10-13 13:35:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 13:35:35 +0200 |
commit | 0bd3cea0ff6d2d4840c0df2938b5ae5c5d7cc4bd (patch) | |
tree | fa9a635db4d34e0a30e13d37f40a0d7a4f92f44a /cli/ops/mod.rs | |
parent | 000ac5c40b71c38cc26a36e579fbb0936f0573d7 (diff) |
refactor(cli): rename GlobalState to ProgramState (#7914)
Diffstat (limited to 'cli/ops/mod.rs')
-rw-r--r-- | cli/ops/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/ops/mod.rs b/cli/ops/mod.rs index b1ec5c344..f5f42a2d7 100644 --- a/cli/ops/mod.rs +++ b/cli/ops/mod.rs @@ -26,8 +26,8 @@ pub mod web_worker; pub mod websocket; pub mod worker_host; -use crate::global_state::GlobalState; use crate::metrics::metrics_op; +use crate::program_state::ProgramState; use deno_core::error::AnyError; use deno_core::json_op_async; use deno_core::json_op_sync; @@ -59,22 +59,22 @@ where /// Helper for checking unstable features. Used for sync ops. pub fn check_unstable(state: &OpState, api_name: &str) { - state.borrow::<Arc<GlobalState>>().check_unstable(api_name) + state.borrow::<Arc<ProgramState>>().check_unstable(api_name) } /// Helper for checking unstable features. Used for async ops. pub fn check_unstable2(state: &Rc<RefCell<OpState>>, api_name: &str) { let state = state.borrow(); - state.borrow::<Arc<GlobalState>>().check_unstable(api_name) + state.borrow::<Arc<ProgramState>>().check_unstable(api_name) } /// Helper for extracting the commonly used state. Used for sync ops. -pub fn global_state(state: &OpState) -> Arc<GlobalState> { - state.borrow::<Arc<GlobalState>>().clone() +pub fn program_state(state: &OpState) -> Arc<ProgramState> { + state.borrow::<Arc<ProgramState>>().clone() } /// Helper for extracting the commonly used state. Used for async ops. -pub fn global_state2(state: &Rc<RefCell<OpState>>) -> Arc<GlobalState> { +pub fn global_state2(state: &Rc<RefCell<OpState>>) -> Arc<ProgramState> { let state = state.borrow(); - state.borrow::<Arc<GlobalState>>().clone() + state.borrow::<Arc<ProgramState>>().clone() } |