(subdir: &str)
| 488 | } |
| 489 | |
| 490 | pub fn get_cache_dir(subdir: &str) -> Result<PathBuf> { |
| 491 | let mut cache_dir = cache_dir().context("Can't get cache dir")?; |
| 492 | cache_dir.push("cloudpub"); |
| 493 | if !subdir.is_empty() { |
| 494 | cache_dir.push(subdir); |
| 495 | } |
| 496 | std::fs::create_dir_all(cache_dir.clone()).context("Can't create cache dir")?; |
| 497 | Ok(cache_dir) |
| 498 | } |
no test coverage detected