summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzwPapEr <zw.paper@gmail.com>2020-01-11 16:15:46 +0800
committerAbin Simon <abinsimon10@gmail.com>2020-01-11 14:17:44 +0530
commitd30f3750781d56eeefa93465df7419cbe4788d07 (patch)
tree1db3fd3cd0d17f7717fc79a2d45e7856c70be72d
parent4e50ea2b55393aad10d3f296325c57d47fb413d0 (diff)
revert the match to if else for blocks
-rw-r--r--src/flags.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/flags.rs b/src/flags.rs
index 8564dbe..1d3b860 100644
--- a/src/flags.rs
+++ b/src/flags.rs
@@ -98,17 +98,19 @@ impl Flags {
None => usize::max_value(),
};
- let mut blocks: Vec<Block> = match () {
- _ if !blocks_inputs.is_empty() => blocks_inputs.into_iter().map(Block::from).collect(),
- _ if matches.is_present("long") => vec![
+ let mut blocks: Vec<Block> = if !blocks_inputs.is_empty() {
+ blocks_inputs.into_iter().map(Block::from).collect()
+ } else if matches.is_present("long") {
+ vec![
Block::Permission,
Block::User,
Block::Group,
Block::Size,
Block::Date,
Block::Name,
- ],
- _ => vec![Block::Name],
+ ]
+ } else {
+ vec![Block::Name]
};
// Add inode as first column if with inode flag