core: code-cleanup: cleaner handling of tree layout boolean

This commit is contained in:
Thomas Magalhaes 2019-05-28 17:51:51 +02:00 committed by Abin Simon
parent a4f6b4bc18
commit 3cb41aff69

View file

@ -64,16 +64,10 @@ impl Core {
fn fetch(&self, paths: Vec<PathBuf>) -> Vec<Meta> {
let mut meta_list = Vec::with_capacity(paths.len());
let tree_layout_true = Layout::Tree { long: true };
let tree_layout_false = Layout::Tree { long: false };
let depth = if self.flags.recursive
|| self.flags.layout == tree_layout_true
|| self.flags.layout == tree_layout_false
{
self.flags.recursion_depth
} else {
1
let depth = match self.flags.layout {
Layout::Tree { .. } => self.flags.recursion_depth,
_ if self.flags.recursive => self.flags.recursion_depth,
_ => 1,
};
for path in paths {