Skip to content

Commit 51c0808

Browse files
schochasticsmaelle
andauthored
Apply suggestions from code review
Co-authored-by: Maëlle Salmon <[email protected]>
1 parent 0f9dcc4 commit 51c0808

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/netzschleuder.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ resolve_name <- function(x) {
4141

4242
if (grepl("/", x)) {
4343
res_names <- strsplit(x, "/", fixed = TRUE)[[1]]
44-
if (length(res_names) > 2) {
44+
bad_names_format <- (length(res_names) > 2)
45+
if (bad_names_format) {
4546
cli::cli_abort(
4647
"{.arg name} is not correctly formatted."
4748
)
4849
}
4950
} else {
5051
res_names <- c(x, x)
5152
}
52-
names(res_names) <- c("collection", "network")
53-
res_names
53+
rlang::set_names(res_names, c("collection", "network"))
5454
}
5555

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

0 commit comments

Comments
 (0)