From 20fb473da852d9b09a592b258c4c183c3d97dc64 Mon Sep 17 00:00:00 2001 From: KAA the Wise Date: Fri, 22 Sep 2023 19:17:51 +0300 Subject: [PATCH] rm: make the `remove` function public --- src/uu/rm/src/rm.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index 96e0fa7aa..19c749cf0 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -279,7 +279,13 @@ pub fn uu_app() -> Command { } // TODO: implement one-file-system (this may get partially implemented in walkdir) -fn remove(files: &[&OsStr], options: &Options) -> bool { +/// Remove (or unlink) the given files +/// +/// Returns true if it has encountered an error. +/// +/// Behavior is determined by the `options` parameter, see [`Options`] for +/// details. +pub fn remove(files: &[&OsStr], options: &Options) -> bool { let mut had_err = false; for filename in files {