diff options
Diffstat (limited to 'src/util/fs.rs')
| -rw-r--r-- | src/util/fs.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/fs.rs b/src/util/fs.rs index b86c0d7..8ecd0d0 100644 --- a/src/util/fs.rs +++ b/src/util/fs.rs | |||
| @@ -2,11 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | use std::path::Path; | 3 | use std::path::Path; |
| 4 | 4 | ||
| 5 | use tokio::fs::remove_file; | ||
| 6 | |||
| 5 | use crate::errors::McError; | 7 | use crate::errors::McError; |
| 6 | 8 | ||
| 7 | pub async fn remove_if_exists(path: &Path) -> Result<(), McError> { | 9 | pub async fn remove_if_exists(path: &Path) -> Result<(), McError> { |
| 8 | if path.exists() { | 10 | if path.exists() { |
| 9 | tokio::fs::remove_file(path).await?; | 11 | remove_file(path).await?; |
| 10 | } | 12 | } |
| 11 | Ok(()) | 13 | Ok(()) |
| 12 | } | 14 | } |
