MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / new

Method new

atomic-cli/src/commands/org/set.rs:251–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

249
250 impl HomeGuard {
251 fn new() -> Self {
252 let tmp = tempfile::tempdir().unwrap();
253 let original = std::env::var_os("ATOMIC_CONFIG_DIR");
254 // SAFETY: env mutation is technically UB under concurrent access.
255 // `#[file_serial]` serializes these tests, and no other test reads
256 // ATOMIC_CONFIG_DIR outside its own `#[file_serial]` block.
257 unsafe {
258 std::env::set_var("ATOMIC_CONFIG_DIR", tmp.path());
259 }
260 Self {
261 _tmp: tmp,
262 original,
263 }
264 }
265 }
266
267 impl Drop for HomeGuard {

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected