(path: &Path)
| 231 | } |
| 232 | |
| 233 | fn remove_if_present(path: &Path) -> Result<(), RepositoryError> { |
| 234 | match std::fs::remove_file(path) { |
| 235 | Err(error) if error.kind() != std::io::ErrorKind::NotFound => Err(error.into()), |
| 236 | _ => Ok(()), |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | /// Make renames in `dir` durable. Directory fsync is only portable on Unix; |
| 241 | /// elsewhere the renames are still atomic. |