From b6e2a0ae249e9edaff816ca568f00cf98efd9d18 Mon Sep 17 00:00:00 2001 From: wolimst <64784258+wolimst@users.noreply.github.com> Date: Wed, 14 Feb 2024 20:02:42 +0900 Subject: [PATCH] cut: refactor mode args counting by removing nested map --- src/uu/cut/src/cut.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/cut/src/cut.rs b/src/uu/cut/src/cut.rs index cf94a1bd061..e8956871692 100644 --- a/src/uu/cut/src/cut.rs +++ b/src/uu/cut/src/cut.rs @@ -368,7 +368,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { matches.indices_of(options::FIELDS), ] .into_iter() - .filter_map(|mode| mode.map(|indices| indices.len())) + .map(|indices| indices.unwrap_or_default().count()) .sum(); let mode_parse = match (