diff options
Diffstat (limited to 'cli/ops/timers.rs')
-rw-r--r-- | cli/ops/timers.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/ops/timers.rs b/cli/ops/timers.rs index ebcbcd706..b9a7dbdf7 100644 --- a/cli/ops/timers.rs +++ b/cli/ops/timers.rs @@ -1,5 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{Deserialize, JsonOp, Value}; +use crate::op_error::OpError; use crate::ops::json_op; use crate::state::State; use deno_core::*; @@ -24,7 +25,7 @@ fn op_global_timer_stop( state: &State, _args: Value, _zero_copy: Option<ZeroCopyBuf>, -) -> Result<JsonOp, ErrBox> { +) -> Result<JsonOp, OpError> { let mut state = state.borrow_mut(); state.global_timer.cancel(); Ok(JsonOp::Sync(json!({}))) @@ -39,7 +40,7 @@ fn op_global_timer( state: &State, args: Value, _zero_copy: Option<ZeroCopyBuf>, -) -> Result<JsonOp, ErrBox> { +) -> Result<JsonOp, OpError> { let args: GlobalTimerArgs = serde_json::from_value(args)?; let val = args.timeout; @@ -61,7 +62,7 @@ fn op_now( state: &State, _args: Value, _zero_copy: Option<ZeroCopyBuf>, -) -> Result<JsonOp, ErrBox> { +) -> Result<JsonOp, OpError> { let state = state.borrow(); let seconds = state.start_time.elapsed().as_secs(); let mut subsec_nanos = state.start_time.elapsed().subsec_nanos(); |