Skip to content

replace rlang::flatten_if() #5223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2023
Merged

Conversation

teunbrand
Copy link
Collaborator

The upcoming rlang 1.1.0 deprecates flatten() and variants, see https://github.com/r-lib/rlang/blob/main/NEWS.md.

The recommended replacement is purrr::list_flatten(), but it seems wild to me that ggplot2 would take on an additional dependency for this 1 occasion that flatten_if() is used.

This PR mimics the logic of purrr::list_flatten() to replace rlang::flatten_if() without taking on {purrr} as a dependency.

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - good catch

@thomasp85 thomasp85 added this to the ggplot2 3.4.2 milestone Mar 13, 2023
@teunbrand teunbrand merged commit 9503d74 into tidyverse:main Mar 14, 2023
@teunbrand teunbrand deleted the replace_flatten_if branch March 14, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants