(tmp: &Path, f: F)
| 7916 | } |
| 7917 | |
| 7918 | fn with_tmp_xdg<F: FnOnce()>(tmp: &Path, f: F) { |
| 7919 | let _guard = TEST_ENV_LOCK |
| 7920 | .lock() |
| 7921 | .unwrap_or_else(std::sync::PoisonError::into_inner); |
| 7922 | let guard = EnvVarGuard::set( |
| 7923 | "XDG_CONFIG_HOME", |
| 7924 | tmp.to_str().expect("temp path should be utf-8"), |
| 7925 | ); |
| 7926 | f(); |
| 7927 | drop(guard); |
| 7928 | } |
| 7929 | fn with_tmp_xdg_and_system<F: FnOnce()>(tmp: &Path, system: &Path, f: F) { |
| 7930 | let _guard = TEST_ENV_LOCK |
| 7931 | .lock() |
no outgoing calls