Skip to content

Commit

Permalink
check installed
Browse files Browse the repository at this point in the history
  • Loading branch information
joethorley committed Aug 5, 2024
1 parent ee5aea8 commit 2c4a0d8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/local-timer.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
local_timer <- function(.local_envir = rlang::caller_env()) {
chk_env(.local_envir)

if(!requireNamespace("withr", quietly = TRUE)) {
err("Package 'withr' must be installed to create a local_timer().")
}
rlang::check_installed("withr", reason = "to create a local_timer().")

tmr <- tmr_start(as_hms(0))
withr::defer(message(tmr_format(tmr)), envir = .local_envir)
Expand Down

0 comments on commit 2c4a0d8

Please sign in to comment.