From 8550f50522c738d6d0477d7ed7830fc82a807835 Mon Sep 17 00:00:00 2001 From: xiuxiu62 Date: Thu, 7 Oct 2021 14:36:47 -0700 Subject: [PATCH] substitute idiomatic call flag check --- crates/nu-command/src/filesystem/cp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/filesystem/cp.rs b/crates/nu-command/src/filesystem/cp.rs index 79751f2c93..b042d50f11 100644 --- a/crates/nu-command/src/filesystem/cp.rs +++ b/crates/nu-command/src/filesystem/cp.rs @@ -60,7 +60,7 @@ impl Command for Cp { } let any_source_is_dir = sources.iter().any(|f| matches!(f, Ok(f) if f.is_dir())); - let recursive = call.named.iter().any(|p| &p.0 == "recursive"); + let recursive: bool = call.has_flag("recursive"); if any_source_is_dir && !recursive { return Err(ShellError::MoveNotPossibleSingle( "Directories must be copied using \"--recursive\"".to_string(),