feat: make trash crate optional on Android

This commit is contained in:
sxyazi 2024-01-30 01:37:15 +08:00
parent 68ffd82c0d
commit d17c8910a6
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -24,7 +24,9 @@ parking_lot = "^0"
regex = "^1"
tokio = { version = "^1", features = [ "parking_lot", "rt-multi-thread" ] }
tokio-stream = "^0"
trash = "^3"
# Logging
tracing = { version = "^0", features = [ "max_level_debug", "release_max_level_warn" ] }
[target.'cfg(not(target_os = "android"))'.dependencies]
trash = "^3"

View file

@ -122,7 +122,7 @@ impl File {
ctx.set_delete_method(DeleteMethod::NsFileManager);
ctx.delete(&task.target)?;
}
#[cfg(not(target_os = "macos"))]
#[cfg(all(not(target_os = "macos"), not(target_os = "android")))]
{
trash::delete(&task.target)?;
}