()
| 106 | } |
| 107 | |
| 108 | fn memtrack_cache_dir() -> Result<PathBuf> { |
| 109 | let cache = std::env::var_os("XDG_CACHE_HOME") |
| 110 | .map(PathBuf::from) |
| 111 | .or_else(|| std::env::var_os("HOME").map(|home| PathBuf::from(home).join(".cache"))) |
| 112 | .context("neither XDG_CACHE_HOME nor HOME is set")?; |
| 113 | Ok(cache.join("codspeed").join("memtrack")) |
| 114 | } |
| 115 | |
| 116 | /// Whether the installed memtrack binary already carries the required capabilities. |
| 117 | pub fn has_memtrack_capabilities() -> bool { |