pinakes-core: check file existence before removal in TempFileGuard drop

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I800825f5dc3b526d350931ff8f1ed0da6a6a6964
This commit is contained in:
raf 2026-03-11 17:23:17 +03:00
commit 0ba898c881
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -27,7 +27,11 @@ impl TempFileGuard {
impl Drop for TempFileGuard {
fn drop(&mut self) {
let _ = std::fs::remove_file(&self.0);
if self.0.exists() {
if let Err(e) = std::fs::remove_file(&self.0) {
warn!("failed to clean up temp file {}: {e}", self.0.display());
}
}
}
}