Skip to content

Commit 47fc1cf

Browse files
committed
named return of resolve_names
1 parent ab13e18 commit 47fc1cf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

R/netzschleuder.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@ resolve_name <- function(x) {
4040
x <- sub("//", "/", x)
4141

4242
if (grepl("/", x)) {
43-
x_split <- strsplit(x, "/", fixed = TRUE)[[1]]
44-
if (length(x_split) > 2) {
43+
res_names <- strsplit(x, "/", fixed = TRUE)[[1]]
44+
if (length(res_names) > 2) {
4545
cli::cli_abort(
46-
"{.arg name} has {length(x_split)} components instead of 2."
46+
"{.arg name} has {length(res_names)} components instead of 2."
4747
)
4848
}
49-
return(x_split)
5049
} else {
51-
c(x, x)
50+
res_names <- c(x, x)
5251
}
52+
names(res_names) <- c("collection", "network")
53+
res_names
5354
}
5455

5556
download_file <- function(zip_url, token = NULL, file, size_limit) {

0 commit comments

Comments
 (0)