Use move_file for rename in tracing

This avoids panicking when the source and destinations are on different
filesystems.
This commit is contained in:
Mark Rousskov 2025-08-30 13:11:21 -04:00
parent e95db591a4
commit 2dc57526c2

View file

@ -168,7 +168,11 @@ mod inner {
impl TracingGuard {
pub fn copy_to_dir(self, dir: &std::path::Path) {
drop(self.guard);
std::fs::rename(&self.chrome_tracing_path, dir.join("chrome-trace.json")).unwrap();
crate::utils::helpers::move_file(
&self.chrome_tracing_path,
dir.join("chrome-trace.json"),
)
.unwrap();
}
}