Skip to content

Commit

Permalink
remove usage of deprecated rlang squash_if.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed May 6, 2024
1 parent 5aecf6f commit 3ae0c79
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion R/events.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ as_event.list <- function(x, step, wall_time, ..., name = ".") {
as_event(obj, step = step, wall_time = wall_time, name = c(name, nm))
}
)
vec_c(!!!rlang::squash_if(unname(ev), vec_is_list))
vec_c(!!!squash_if(unname(ev), vec_is_list))
}

squash_if <- function(x, predicate) {
lapply(x, function(obj) {
if (predicate(obj)) {
unlist(obj)
} else {
obj
}
})
}

#' @export
Expand Down

0 comments on commit 3ae0c79

Please sign in to comment.