@@ -70,8 +70,8 @@ check_bool <- function(
7070 ... ,
7171 allow_na = FALSE ,
7272 allow_null = FALSE ,
73- arg = rlang :: caller_arg(x ),
74- call = rlang :: caller_env()
73+ arg = caller_arg(x ),
74+ call = caller_env()
7575) {
7676 if (
7777 ! missing(x ) &&
@@ -102,8 +102,8 @@ check_string <- function(
102102 allow_empty = TRUE ,
103103 allow_na = FALSE ,
104104 allow_null = FALSE ,
105- arg = rlang :: caller_arg(x ),
106- call = rlang :: caller_env()
105+ arg = caller_arg(x ),
106+ call = caller_env()
107107) {
108108 if (! missing(x )) {
109109 is_string <- .rlang_check_is_string(
@@ -129,13 +129,13 @@ check_string <- function(
129129}
130130
131131.rlang_check_is_string <- function (x , allow_empty , allow_na , allow_null ) {
132- if (rlang :: is_string(x )) {
133- if (allow_empty || ! rlang :: is_string(x , " " )) {
132+ if (is_string(x )) {
133+ if (allow_empty || ! is_string(x , " " )) {
134134 return (TRUE )
135135 }
136136 }
137137
138- if (allow_null && rlang :: is_null(x )) {
138+ if (allow_null && is_null(x )) {
139139 return (TRUE )
140140 }
141141
@@ -150,8 +150,8 @@ check_name <- function(
150150 x ,
151151 ... ,
152152 allow_null = FALSE ,
153- arg = rlang :: caller_arg(x ),
154- call = rlang :: caller_env()
153+ arg = caller_arg(x ),
154+ call = caller_env()
155155) {
156156 if (! missing(x )) {
157157 is_string <- .rlang_check_is_string(
@@ -188,8 +188,8 @@ check_number_decimal <- function(
188188 allow_infinite = TRUE ,
189189 allow_na = FALSE ,
190190 allow_null = FALSE ,
191- arg = rlang :: caller_arg(x ),
192- call = rlang :: caller_env()
191+ arg = caller_arg(x ),
192+ call = caller_env()
193193) {
194194 if (missing(x )) {
195195 exit_code <- IS_NUMBER_false
@@ -231,8 +231,8 @@ check_number_whole <- function(
231231 allow_infinite = FALSE ,
232232 allow_na = FALSE ,
233233 allow_null = FALSE ,
234- arg = rlang :: caller_arg(x ),
235- call = rlang :: caller_env()
234+ arg = caller_arg(x ),
235+ call = caller_env()
236236) {
237237 if (missing(x )) {
238238 exit_code <- IS_NUMBER_false
@@ -295,7 +295,7 @@ check_number_whole <- function(
295295 } else if (x > max ) {
296296 what <- sprintf(" %s smaller than or equal to %s" , what , max )
297297 } else {
298- rlang :: abort(" Unexpected state in OOB check" , .internal = TRUE )
298+ abort(" Unexpected state in OOB check" , .internal = TRUE )
299299 }
300300 }
301301
@@ -314,14 +314,14 @@ check_symbol <- function(
314314 x ,
315315 ... ,
316316 allow_null = FALSE ,
317- arg = rlang :: caller_arg(x ),
318- call = rlang :: caller_env()
317+ arg = caller_arg(x ),
318+ call = caller_env()
319319) {
320320 if (! missing(x )) {
321- if (rlang :: is_symbol(x )) {
321+ if (is_symbol(x )) {
322322 return (invisible (NULL ))
323323 }
324- if (allow_null && rlang :: is_null(x )) {
324+ if (allow_null && is_null(x )) {
325325 return (invisible (NULL ))
326326 }
327327 }
@@ -341,14 +341,14 @@ check_arg <- function(
341341 x ,
342342 ... ,
343343 allow_null = FALSE ,
344- arg = rlang :: caller_arg(x ),
345- call = rlang :: caller_env()
344+ arg = caller_arg(x ),
345+ call = caller_env()
346346) {
347347 if (! missing(x )) {
348- if (rlang :: is_symbol(x )) {
348+ if (is_symbol(x )) {
349349 return (invisible (NULL ))
350350 }
351- if (allow_null && rlang :: is_null(x )) {
351+ if (allow_null && is_null(x )) {
352352 return (invisible (NULL ))
353353 }
354354 }
@@ -368,14 +368,14 @@ check_call <- function(
368368 x ,
369369 ... ,
370370 allow_null = FALSE ,
371- arg = rlang :: caller_arg(x ),
372- call = rlang :: caller_env()
371+ arg = caller_arg(x ),
372+ call = caller_env()
373373) {
374374 if (! missing(x )) {
375- if (rlang :: is_call(x )) {
375+ if (is_call(x )) {
376376 return (invisible (NULL ))
377377 }
378- if (allow_null && rlang :: is_null(x )) {
378+ if (allow_null && is_null(x )) {
379379 return (invisible (NULL ))
380380 }
381381 }
@@ -395,14 +395,14 @@ check_environment <- function(
395395 x ,
396396 ... ,
397397 allow_null = FALSE ,
398- arg = rlang :: caller_arg(x ),
399- call = rlang :: caller_env()
398+ arg = caller_arg(x ),
399+ call = caller_env()
400400) {
401401 if (! missing(x )) {
402- if (rlang :: is_environment(x )) {
402+ if (is_environment(x )) {
403403 return (invisible (NULL ))
404404 }
405- if (allow_null && rlang :: is_null(x )) {
405+ if (allow_null && is_null(x )) {
406406 return (invisible (NULL ))
407407 }
408408 }
@@ -422,14 +422,14 @@ check_function <- function(
422422 x ,
423423 ... ,
424424 allow_null = FALSE ,
425- arg = rlang :: caller_arg(x ),
426- call = rlang :: caller_env()
425+ arg = caller_arg(x ),
426+ call = caller_env()
427427) {
428428 if (! missing(x )) {
429- if (rlang :: is_function(x )) {
429+ if (is_function(x )) {
430430 return (invisible (NULL ))
431431 }
432- if (allow_null && rlang :: is_null(x )) {
432+ if (allow_null && is_null(x )) {
433433 return (invisible (NULL ))
434434 }
435435 }
@@ -449,14 +449,14 @@ check_closure <- function(
449449 x ,
450450 ... ,
451451 allow_null = FALSE ,
452- arg = rlang :: caller_arg(x ),
453- call = rlang :: caller_env()
452+ arg = caller_arg(x ),
453+ call = caller_env()
454454) {
455455 if (! missing(x )) {
456- if (rlang :: is_closure(x )) {
456+ if (is_closure(x )) {
457457 return (invisible (NULL ))
458458 }
459- if (allow_null && rlang :: is_null(x )) {
459+ if (allow_null && is_null(x )) {
460460 return (invisible (NULL ))
461461 }
462462 }
@@ -476,14 +476,14 @@ check_formula <- function(
476476 x ,
477477 ... ,
478478 allow_null = FALSE ,
479- arg = rlang :: caller_arg(x ),
480- call = rlang :: caller_env()
479+ arg = caller_arg(x ),
480+ call = caller_env()
481481) {
482482 if (! missing(x )) {
483- if (rlang :: is_formula(x )) {
483+ if (is_formula(x )) {
484484 return (invisible (NULL ))
485485 }
486- if (allow_null && rlang :: is_null(x )) {
486+ if (allow_null && is_null(x )) {
487487 return (invisible (NULL ))
488488 }
489489 }
@@ -509,13 +509,13 @@ check_character <- function(
509509 ... ,
510510 allow_na = TRUE ,
511511 allow_null = FALSE ,
512- arg = rlang :: caller_arg(x ),
513- call = rlang :: caller_env()
512+ arg = caller_arg(x ),
513+ call = caller_env()
514514) {
515515 if (! missing(x )) {
516- if (rlang :: is_character(x )) {
516+ if (is_character(x )) {
517517 if (! allow_na && any(is.na(x ))) {
518- rlang :: abort(
518+ abort(
519519 sprintf(" `%s` can't contain NA values." , arg ),
520520 arg = arg ,
521521 call = call
@@ -525,7 +525,7 @@ check_character <- function(
525525 return (invisible (NULL ))
526526 }
527527
528- if (allow_null && rlang :: is_null(x )) {
528+ if (allow_null && is_null(x )) {
529529 return (invisible (NULL ))
530530 }
531531 }
@@ -544,14 +544,14 @@ check_logical <- function(
544544 x ,
545545 ... ,
546546 allow_null = FALSE ,
547- arg = rlang :: caller_arg(x ),
548- call = rlang :: caller_env()
547+ arg = caller_arg(x ),
548+ call = caller_env()
549549) {
550550 if (! missing(x )) {
551- if (rlang :: is_logical(x )) {
551+ if (is_logical(x )) {
552552 return (invisible (NULL ))
553553 }
554- if (allow_null && rlang :: is_null(x )) {
554+ if (allow_null && is_null(x )) {
555555 return (invisible (NULL ))
556556 }
557557 }
@@ -571,14 +571,14 @@ check_data_frame <- function(
571571 x ,
572572 ... ,
573573 allow_null = FALSE ,
574- arg = rlang :: caller_arg(x ),
575- call = rlang :: caller_env()
574+ arg = caller_arg(x ),
575+ call = caller_env()
576576) {
577577 if (! missing(x )) {
578578 if (is.data.frame(x )) {
579579 return (invisible (NULL ))
580580 }
581- if (allow_null && rlang :: is_null(x )) {
581+ if (allow_null && is_null(x )) {
582582 return (invisible (NULL ))
583583 }
584584 }
0 commit comments