mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +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 squeeze_flag = matches.is_present(options::SQUEEZE);
|
||||||
let truncate_flag = matches.is_present(options::TRUNCATE);
|
let truncate_flag = matches.is_present(options::TRUNCATE);
|
||||||
|
|
||||||
let sets = match matches.values_of(options::SETS) {
|
let sets = matches
|
||||||
Some(v) => v.map(|v| v.to_string()).collect(),
|
.values_of(options::SETS)
|
||||||
None => vec![],
|
.map(|v| v.map(ToString::to_string).collect::<Vec<_>>())
|
||||||
};
|
.unwrap_or_default();
|
||||||
|
|
||||||
if sets.is_empty() {
|
if sets.is_empty() {
|
||||||
show_error!(
|
show_error!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue