diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-09-14 18:48:57 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2020-09-15 01:50:52 +0200 |
commit | f5b40c918c7d602827622d167728a3e7bae87d9d (patch) | |
tree | fb51722e043f4d6bce64a2c7e897cce4ead06c82 /cli/ops/timers.rs | |
parent | 3da20d19a14ab6838897d281f1b11e49d68bd1a7 (diff) |
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476)
Diffstat (limited to 'cli/ops/timers.rs')
-rw-r--r-- | cli/ops/timers.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/ops/timers.rs b/cli/ops/timers.rs index 3ce2b5633..a8f5be900 100644 --- a/cli/ops/timers.rs +++ b/cli/ops/timers.rs @@ -1,7 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +use deno_core::error::AnyError; use deno_core::BufVec; -use deno_core::ErrBox; use deno_core::OpState; use deno_core::ZeroCopyBuf; use futures::future::FutureExt; @@ -22,7 +22,7 @@ fn op_global_timer_stop( state: &mut OpState, _args: Value, _zero_copy: &mut [ZeroCopyBuf], -) -> Result<Value, ErrBox> { +) -> Result<Value, AnyError> { let cli_state = super::cli_state(state); cli_state.global_timer.borrow_mut().cancel(); Ok(json!({})) @@ -37,7 +37,7 @@ async fn op_global_timer( state: Rc<RefCell<OpState>>, args: Value, _zero_copy: BufVec, -) -> Result<Value, ErrBox> { +) -> Result<Value, AnyError> { let args: GlobalTimerArgs = serde_json::from_value(args)?; let val = args.timeout; @@ -61,7 +61,7 @@ fn op_now( state: &mut OpState, _args: Value, _zero_copy: &mut [ZeroCopyBuf], -) -> Result<Value, ErrBox> { +) -> Result<Value, AnyError> { let cli_state = super::cli_state(state); let seconds = cli_state.start_time.elapsed().as_secs(); let mut subsec_nanos = cli_state.start_time.elapsed().subsec_nanos(); |