mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 10:45:45 +00:00
tree() in crates/engine/src/cmd/findfiles/tests.rs returns a Tree guard that holds the canonical path and removes the folder with everything in it when it is dropped, also when the test panics. When the removal fails, the guard gives the owner read, write and search permission on every folder in the tree (Unix; links are not followed) and removes it again, so a test that panics while a folder is locked leaves nothing behind. A removal that still fails is ignored. tree() empties the folder temp_dir returns in place instead of removing and remaking it, so on Unix the folder keeps the owner-only mode that temp_dir sets.