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"))]
async fn trash_file(&self, path: &Path, _options: RemoveOptions) -> Result<()> {
if let Ok(Some(metadata)) = self.metadata(path).await {
if 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;
}
if let Ok(Some(metadata)) = self.metadata(path).await
&& 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;
}
let file = smol::fs::File::open(path).await?;
match trash::trash_file(&file.as_fd()).await {