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

Method new

atomic-cli/src/commands/workspace/set.rs:276–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

274
275 impl HomeGuard {
276 fn new() -> Self {
277 let tmp = tempfile::tempdir().unwrap();
278 let original = std::env::var_os("ATOMIC_CONFIG_DIR");
279 // SAFETY: env mutation is technically UB under concurrent access.
280 // `#[file_serial]` serializes these tests, and no other test reads
281 // ATOMIC_CONFIG_DIR outside its own `#[file_serial]` block.
282 unsafe {
283 std::env::set_var("ATOMIC_CONFIG_DIR", tmp.path());
284 }
285 Self {
286 _tmp: tmp,
287 original,
288 }
289 }
290 }
291
292 impl Drop for HomeGuard {

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected