Skip to content

Commit 35519b9

Browse files
Simplify styler_df() signature (#1009)
* Get rid of unnecessary `.name_repair` arg This is generating warnings. Follow-up on #1007 * make the wrapper even thinner
1 parent 1a8bab3 commit 35519b9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

R/parse.R

+3-5
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ get_parse_data <- function(text, include_text = TRUE, ...) {
9494
# avoid https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16041
9595
parse_safely(text, keep.source = TRUE)
9696
parsed <- parse_safely(text, keep.source = TRUE)
97-
pd <- styler_df(
98-
utils::getParseData(parsed, includeText = include_text),
99-
.name_repair = "minimal"
100-
)
97+
pd <- utils::getParseData(parsed, includeText = include_text) %>%
98+
styler_df()
10199
if (getRversion() < "4.2") {
102100
is_unicode_parsing_error <- grepl("^\"<U\\+[0-9]+>\"$", pd$text)
103101
if (any(is_unicode_parsing_error)) {
@@ -163,7 +161,7 @@ ensure_correct_txt <- function(pd, text) {
163161
by.y = "id",
164162
suffixes = c("", "parent")
165163
) %>%
166-
styler_df(.name_repair = "minimal")
164+
styler_df()
167165

168166
if (!lines_and_cols_match(new_text)) {
169167
abort(paste(

R/utils.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ line_col_names <- function() {
77
#' Wrapper functions to encapsulate data frame creation
88
#' @keywords internal
99
#' @noRd
10-
styler_df <- function(..., .size = NULL, .name_repair = "minimal") {
11-
vctrs::data_frame(..., .size = .size, .name_repair = .name_repair)
10+
styler_df <- function(...) {
11+
vctrs::data_frame(..., .name_repair = "minimal")
1212
}
1313

1414
#' @keywords internal

0 commit comments

Comments
 (0)