This commit is contained in:
Piotr Osiewicz 2025-08-18 20:57:31 +02:00
parent f13ea62842
commit 5b6b3f553e

View file

@ -468,11 +468,11 @@ impl Fs for RealFs {
#[cfg(any(target_os = "linux", target_os = "freebsd"))] #[cfg(any(target_os = "linux", target_os = "freebsd"))]
async fn trash_file(&self, path: &Path, _options: RemoveOptions) -> Result<()> { async fn trash_file(&self, path: &Path, _options: RemoveOptions) -> Result<()> {
if let Ok(Some(metadata)) = self.metadata(path).await { if let Ok(Some(metadata)) = self.metadata(path).await
if metadata.is_symlink { && metadata.is_symlink
// TODO: trash_file does not support trashing symlinks yet - https://github.com/bilelmoussaoui/ashpd/issues/255 {
return self.remove_file(path, RemoveOptions::default()).await; // TODO: trash_file does not support trashing symlinks yet - https://github.com/bilelmoussaoui/ashpd/issues/255
} return self.remove_file(path, RemoveOptions::default()).await;
} }
let file = smol::fs::File::open(path).await?; let file = smol::fs::File::open(path).await?;
match trash::trash_file(&file.as_fd()).await { match trash::trash_file(&file.as_fd()).await {