Fix stop suggesting --trash when already enabled (issue #12361) (#12362)

fixes #12361

Looking at the condition, `TRASH_SUPPORTED && (trash || (rm_always_trash
&& !permanent))`, this code path seems only to run when `--trash` is
enabled and `--permanent` is disabled.

This suggests that the `--trash` suggestion is a mistake and should have
suggested `--permanent`.
This commit is contained in:
Ethan Brierley 2024-04-06 02:28:40 +01:00 committed by GitHub
parent 88ff622b16
commit 00b576b7f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -382,7 +382,10 @@ fn rm(
))]
{
trash::delete(&f).map_err(|e: trash::Error| {
Error::new(ErrorKind::Other, format!("{e:?}\nTry '--trash' flag"))
Error::new(
ErrorKind::Other,
format!("{e:?}\nTry '--permanent' flag"),
)
})
}