Skip to content

Commit 066df62

Browse files
committed
refactor(rm): replace map_or with is_some_and for preserve_root_all check
Use the more idiomatic `is_some_and` method to check if the "all" value is present in the preserve_root options, improving code readability and leveraging modern Rust features.
1 parent 0bd8995 commit 066df62

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
@@ -256,7 +256,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
256256
preserve_root: !matches.get_flag(OPT_NO_PRESERVE_ROOT),
257257
preserve_root_all: matches
258258
.get_many::<String>(OPT_PRESERVE_ROOT)
259-
.map_or(false, |mut values| values.any(|v| v == "all")),
259+
.is_some_and(|mut values| values.any(|v| v == "all")),
260260
recursive: matches.get_flag(OPT_RECURSIVE),
261261
dir: matches.get_flag(OPT_DIR),
262262
verbose: matches.get_flag(OPT_VERBOSE),

0 commit comments

Comments
 (0)