From 880108eb79208e643e47081d5fef56f89273ff94 Mon Sep 17 00:00:00 2001 From: oech3 <> Date: Sun, 7 Jun 2026 20:55:00 +0900 Subject: [PATCH] cp: replace match by is_ok_and --- src/uu/cp/src/platform/linux.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/uu/cp/src/platform/linux.rs b/src/uu/cp/src/platform/linux.rs index 328c3f4a1..05feaf14f 100644 --- a/src/uu/cp/src/platform/linux.rs +++ b/src/uu/cp/src/platform/linux.rs @@ -192,12 +192,7 @@ where /// Checks whether an existing destination is a fifo fn check_dest_is_fifo(dest: &Path) -> bool { // If our destination file exists and its a fifo , we do a standard copy . - let file_type = std::fs::metadata(dest); - match file_type { - Ok(f) => f.file_type().is_fifo(), - - _ => false, - } + std::fs::metadata(dest).is_ok_and(|f| f.file_type().is_fifo()) } /// Copy the contents of a stream from `source` to `dest`.