feat: make trash crate optional on Android (#600)

This commit is contained in:
三咲雅 · Misaki Masa 2024-01-31 21:54:19 +08:00 committed by GitHub
parent b013dff4fe
commit e6079438a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)?;
}