Skip to content

Commit d433e7c

Browse files
songoao25EtienneLescot
authored andcommitted
docs(test): describe temporary directory ownership and cleanup
1 parent d68bb20 commit d433e7c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎crates/compositor/tests/export_timing.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const SOURCE_SEC: f64 = 4.0;
5353
struct TestOutputDir(PathBuf);
5454

5555
impl TestOutputDir {
56+
/// Create a fresh directory without reusing or deleting an existing path.
5657
fn new(label: &str) -> Self {
5758
let nonce = std::time::SystemTime::now()
5859
.duration_since(std::time::UNIX_EPOCH)
@@ -66,6 +67,7 @@ impl TestOutputDir {
6667
}
6768

6869
impl Drop for TestOutputDir {
70+
/// Report cleanup errors without causing a second panic during unwinding.
6971
fn drop(&mut self) {
7072
if let Err(error) = std::fs::remove_dir_all(&self.0) {
7173
eprintln!("Could not clean test output directory: {error}");

0 commit comments

Comments
 (0)