Replace rappdirs by tools::R_user_dir()
I see that this change was made in other r-lib repos so I thought I'd suggest it here as well.
tools::R_user_dir() was introduced in R 4.0 so safe to use with the tidyverse R version support policy/
I think this probably needs a bit more thought than in other packages, because we'd need to make sure that this directory eventually gets cleaned up.
But I don't see any mechanism in rappdirs to clean up. My understanding is that the user or the OS takes care of this. In which case, the situation should be the same with the folder created by tools::R_user_dir().
As far as I understand, the main difference between rappdirs and tools::R_user_dir() is that rappdirs covers the different cases (config, cache, etc.) via different functions while tools::R_user_dir() does it via its which argument.
Am I missing something?
httr2 has cache_disk_prune() which is called automatically on load, and ensures that all tokens > 30 days old are deleted. These tokens can be used to do stuff on your behalf so I wanted to avoid having them lay around for an unlimited amount of time.