Skip to content

Commit

Permalink
Merge pull request #92 from traP-jp/fix/#91-file-drop-symlink
Browse files Browse the repository at this point in the history
droptraitを入れました
  • Loading branch information
yuiveslkao authored Jan 6, 2025
2 parents 2f6ba98 + 77b17ef commit 02c6c78
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions judge_control_app/src/custom_rc/readonly_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ impl ReadonlyFile {
}
}

impl Drop for ReadonlyFile {
fn drop(&mut self) {
let result = std::fs::remove_file(&self.path).context(format!(
"Failed to remove file while dropping ReadonlyFile : {:?}",
self.path
));
match result {
Ok(_) => {}
Err(e) => {
eprintln!("{:?}", e);
}
}
}
}
impl super::File for ReadonlyFile {
fn path(&self) -> PathBuf {
self.path.clone()
Expand Down

0 comments on commit 02c6c78

Please sign in to comment.