@@ -41,7 +41,7 @@ to_toml <- function(...,
4141 names <- names2(args )
4242
4343 # We disallow unnamed top-level atomic arguments
44- invalid <- which(map2_lgl(names , args , ~ ! nzchar(.x ) && is.atomic(.y )))
44+ invalid <- which(map2_lgl(names , args , \( .x , .y ) ! nzchar(.x ) && is.atomic(.y )))
4545
4646 # If such args found, display an error message
4747 if (length(invalid ) > 0 ) {
@@ -97,13 +97,13 @@ get_toml_missing_msg <- function() {
9797simplify_row <- function (row ) {
9898 result <- map_if(
9999 row ,
100- ~ is.list(.x ) && all(! nzchar(names2(.x ))),
101- ~ .x [1 ],
102- .else = ~ .x
100+ \( .x ) is.list(.x ) && all(! nzchar(names2(.x ))),
101+ \( .x ) .x [1 ],
102+ .else = identity
103103 )
104104 discard(
105105 result ,
106- ~ is_na(.x ) || is_null(unlist(.x ))
106+ \( .x ) is_na(.x ) || is_null(unlist(.x ))
107107 )
108108}
109109
@@ -203,7 +203,7 @@ format_toml_atomic <- function(x,
203203 " [ ]"
204204 } else {
205205 formatter <- rlang :: as_function(.formatter )
206- items <- glue_collapse(formatter(x , ... ), " , " )
206+ items <- glue_collapse(formatter(x ), " , " )
207207 if (len > 1L || ! is.null(dims )) {
208208 items <- glue(" [ {items} ]" )
209209 }
@@ -223,9 +223,9 @@ format_toml.character <- function(x,
223223 .str_as_literal = TRUE ,
224224 .top_level = FALSE ) {
225225 if (isTRUE(.str_as_literal )) {
226- .formatter <- ~ glue(" '{.x}'" )
226+ .formatter <- \( .x ) glue(" '{.x}'" )
227227 } else {
228- .formatter <- ~ glue(" \" {escape_dbl_quotes(.x)}\" " )
228+ .formatter <- \( .x ) glue(" \" {escape_dbl_quotes(.x)}\" " )
229229 }
230230 format_toml_atomic(
231231 x ,
@@ -246,7 +246,7 @@ format_toml.integer <- function(x,
246246 ... ,
247247 .format_int = .format_int ,
248248 .top_level = FALSE ,
249- .formatter = ~ sprintf(.format_int , .x )
249+ .formatter = \( .x ) sprintf(.format_int , .x )
250250 )
251251}
252252
@@ -260,7 +260,7 @@ format_toml.double <- function(x,
260260 ... ,
261261 .format_dbl = .format_dbl ,
262262 .top_level = FALSE ,
263- .formatter = ~ sprintf(.format_dbl , .x )
263+ .formatter = \( .x ) sprintf(.format_dbl , .x )
264264 )
265265}
266266
@@ -272,7 +272,7 @@ format_toml.logical <- function(x,
272272 x ,
273273 ... ,
274274 .top_level = FALSE ,
275- .formatter = ~ ifelse(.x , " true" , " false" )
275+ .formatter = \( .x ) ifelse(.x , " true" , " false" )
276276 )
277277}
278278
0 commit comments