mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 14:12:31 +00:00
revert the match to if else for blocks
This commit is contained in:
parent
4e50ea2b55
commit
d30f375078
1 changed files with 7 additions and 5 deletions
12
src/flags.rs
12
src/flags.rs
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue