mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Use map/default instead of match
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
This commit is contained in:
parent
199b4e437b
commit
15f6e35163
1 changed files with 4 additions and 4 deletions
|
@ -259,10 +259,10 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
let squeeze_flag = matches.is_present(options::SQUEEZE);
|
||||
let truncate_flag = matches.is_present(options::TRUNCATE);
|
||||
|
||||
let sets = match matches.values_of(options::SETS) {
|
||||
Some(v) => v.map(|v| v.to_string()).collect(),
|
||||
None => vec![],
|
||||
};
|
||||
let sets = matches
|
||||
.values_of(options::SETS)
|
||||
.map(|v| v.map(ToString::to_string).collect::<Vec<_>>())
|
||||
.unwrap_or_default();
|
||||
|
||||
if sets.is_empty() {
|
||||
show_error!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue