summaryrefslogtreecommitdiff
path: root/cli/ops/runtime.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-09-18 20:39:47 +0200
committerGitHub <noreply@github.com>2020-09-18 20:39:47 +0200
commitf44522eac9c9f13835d4df62135bb5728a000239 (patch)
tree1c7eb59691e1ffbf8b1620bd34227fa25033ff78 /cli/ops/runtime.rs
parent4fcfff0393a90bef6313df2c8895cd285da29440 (diff)
refactor: move fields from CliState to OpState (#7558)
- move rng to OpState - move GlobalTimer to OpState - move Metrics to OpState
Diffstat (limited to 'cli/ops/runtime.rs')
-rw-r--r--cli/ops/runtime.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/ops/runtime.rs b/cli/ops/runtime.rs
index c2ebc93f7..4c5775bcd 100644
--- a/cli/ops/runtime.rs
+++ b/cli/ops/runtime.rs
@@ -1,6 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::colors;
+use crate::metrics::Metrics;
use crate::version;
use crate::DenoSubcommand;
use deno_core::error::AnyError;
@@ -61,8 +62,7 @@ fn op_metrics(
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
) -> Result<Value, AnyError> {
- let cli_state = super::cli_state(state);
- let m = &cli_state.metrics.borrow();
+ let m = state.borrow::<Metrics>();
Ok(json!({
"opsDispatched": m.ops_dispatched,