summaryrefslogtreecommitdiffstats
path: root/src/source
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-11 14:39:02 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-11 17:05:26 +0100
commitdad8d26bb3d5bc0a1bb61fb074c87600d93518bf (patch)
tree4669483d34fd21fd50706c47b34732ee88de1694 /src/source
parentf05ebcf1d2066c3499a4ac64d47265bf4b695c5c (diff)
Add SourceEntry::remove_file() helper
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/source')
-rw-r--r--src/source/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/source/mod.rs b/src/source/mod.rs
index 90e69d8..ae305ad 100644
--- a/src/source/mod.rs
+++ b/src/source/mod.rs
@@ -57,6 +57,10 @@ impl SourceEntry {
self.package_source.url()
}
+ pub async fn remove_file(&self) -> Result<()> {
+ tokio::fs::remove_file(&self.package_source_path).await.map_err(Error::from)
+ }
+
pub async fn verify_hash(&self) -> Result<bool> {
use tokio::io::AsyncReadExt;