From 6bec96aad1c6ae606f2c1c05bda51904cd88f5eb 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 cf94a1bd0..e89568716 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 (