revert the match to if else for blocks

This commit is contained in:
zwPapEr 2020-01-11 16:15:46 +08:00 committed by Abin Simon
parent 4e50ea2b55
commit d30f375078

View file

@ -98,17 +98,19 @@ impl Flags {
None => usize::max_value(), None => usize::max_value(),
}; };
let mut blocks: Vec<Block> = match () { let mut blocks: Vec<Block> = if !blocks_inputs.is_empty() {
_ if !blocks_inputs.is_empty() => blocks_inputs.into_iter().map(Block::from).collect(), blocks_inputs.into_iter().map(Block::from).collect()
_ if matches.is_present("long") => vec![ } else if matches.is_present("long") {
vec![
Block::Permission, Block::Permission,
Block::User, Block::User,
Block::Group, Block::Group,
Block::Size, Block::Size,
Block::Date, Block::Date,
Block::Name, Block::Name,
], ]
_ => vec![Block::Name], } else {
vec![Block::Name]
}; };
// Add inode as first column if with inode flag // Add inode as first column if with inode flag