Skip to content

Commit 584f900

Browse files
committed
fix(rm): update error message to use to_string_lossy for directory path
Changed the RefusingToRemoveDirectory error formatting from _0.quote() to _0.to_string_lossy() to ensure the OsString path is displayed correctly as a lossy string, likely for consistency with GNU rm behavior or to avoid quoting issues.
1 parent 066df62 commit 584f900

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uu/rm/src/rm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ enum RmError {
4545
DangerousRecursiveOperation,
4646
#[error("{}", translate!("rm-error-use-no-preserve-root"))]
4747
UseNoPreserveRoot,
48-
#[error("{}", translate!("rm-error-refusing-to-remove-directory", "path" => _0.quote()))]
48+
#[error("{}", translate!("rm-error-refusing-to-remove-directory", "path" => _0.to_string_lossy()))]
4949
RefusingToRemoveDirectory(OsString),
5050
#[error("{}", translate!("rm-error-skipping-directory-on-different-device", "path" => _0.to_string_lossy()))]
5151
#[cfg(unix)]

0 commit comments

Comments
 (0)